import * as Cesium from 'cesium/Cesium'
!function (e, t) {
    "use strict";
    t = t && t.hasOwnProperty("default") ? t.default : t;
    const i = new WeakMap, n = e => (...t) => {
            const n = e(...t);
            return i.set(n, !0), n
        }, o = e => "function" == typeof e && i.has(e),
        r = void 0 !== window.customElements && void 0 !== window.customElements.polyfillWrapFlushCallback,
        a = (e, t, i = null) => {
            for (; t !== i;) {
                const i = t.nextSibling;
                e.removeChild(t), t = i
            }
        }, s = {}, c = {}, l = `{{lit-${String(Math.random()).slice(2)}}}`, d = `\x3c!--${l}--\x3e`,
        u = new RegExp(`${l}|${d}`);

    class h {
        constructor(e, t) {
            this.parts = [], this.element = t;
            const i = [], n = [], o = document.createTreeWalker(t.content, 133, null, !1);
            let r = 0, a = -1, s = 0;
            const {strings: c, values: {length: d}} = e;
            for (; s < d;) {
                const e = o.nextNode();
                if (null !== e) {
                    if (a++, 1 === e.nodeType) {
                        if (e.hasAttributes()) {
                            const t = e.attributes, {length: i} = t;
                            let n = 0;
                            for (let e = 0; e < i; e++) p(t[e].name, "$lit$") && n++;
                            for (; n-- > 0;) {
                                const t = c[s], i = g.exec(t)[2], n = i.toLowerCase() + "$lit$", o = e.getAttribute(n);
                                e.removeAttribute(n);
                                const r = o.split(u);
                                this.parts.push({type: "attribute", index: a, name: i, strings: r}), s += r.length - 1
                            }
                        }
                        "TEMPLATE" === e.tagName && (n.push(e), o.currentNode = e.content)
                    } else if (3 === e.nodeType) {
                        const t = e.data;
                        if (t.indexOf(l) >= 0) {
                            const n = e.parentNode, o = t.split(u), r = o.length - 1;
                            for (let t = 0; t < r; t++) {
                                let i, r = o[t];
                                if ("" === r) i = f(); else {
                                    const e = g.exec(r);
                                    null !== e && p(e[2], "$lit$") && (r = r.slice(0, e.index) + e[1] + e[2].slice(0, -"$lit$".length) + e[3]), i = document.createTextNode(r)
                                }
                                n.insertBefore(i, e), this.parts.push({type: "node", index: ++a})
                            }
                            "" === o[r] ? (n.insertBefore(f(), e), i.push(e)) : e.data = o[r], s += r
                        }
                    } else if (8 === e.nodeType) if (e.data === l) {
                        const t = e.parentNode;
                        null !== e.previousSibling && a !== r || (a++, t.insertBefore(f(), e)), r = a, this.parts.push({
                            type: "node",
                            index: a
                        }), null === e.nextSibling ? e.data = "" : (i.push(e), a--), s++
                    } else {
                        let t = -1;
                        for (; -1 !== (t = e.data.indexOf(l, t + 1));) this.parts.push({type: "node", index: -1}), s++
                    }
                } else o.currentNode = n.pop()
            }
            for (const e of i) e.parentNode.removeChild(e)
        }
    }

    const p = (e, t) => {
            const i = e.length - t.length;
            return i >= 0 && e.slice(i) === t
        }, m = e => -1 !== e.index, f = () => document.createComment(""),
        g = /([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;

    class b {
        constructor(e, t, i) {
            this.__parts = [], this.template = e, this.processor = t, this.options = i
        }

        update(e) {
            let t = 0;
            for (const i of this.__parts) void 0 !== i && i.setValue(e[t]), t++;
            for (const e of this.__parts) void 0 !== e && e.commit()
        }

        _clone() {
            const e = r ? this.template.element.content.cloneNode(!0) : document.importNode(this.template.element.content, !0),
                t = [], i = this.template.parts, n = document.createTreeWalker(e, 133, null, !1);
            let o, a = 0, s = 0, c = n.nextNode();
            for (; a < i.length;) if (o = i[a], m(o)) {
                for (; s < o.index;) s++, "TEMPLATE" === c.nodeName && (t.push(c), n.currentNode = c.content), null === (c = n.nextNode()) && (n.currentNode = t.pop(), c = n.nextNode());
                if ("node" === o.type) {
                    const e = this.processor.handleTextExpression(this.options);
                    e.insertAfterNode(c.previousSibling), this.__parts.push(e)
                } else this.__parts.push(...this.processor.handleAttributeExpressions(c, o.name, o.strings, this.options));
                a++
            } else this.__parts.push(void 0), a++;
            return r && (document.adoptNode(e), customElements.upgrade(e)), e
        }
    }

    const v = ` ${l} `;

    class _ {
        constructor(e, t, i, n) {
            this.strings = e, this.values = t, this.type = i, this.processor = n
        }

        getHTML() {
            const e = this.strings.length - 1;
            let t = "", i = !1;
            for (let n = 0; n < e; n++) {
                const e = this.strings[n], o = e.lastIndexOf("\x3c!--");
                i = (o > -1 || i) && -1 === e.indexOf("--\x3e", o + 1);
                const r = g.exec(e);
                t += null === r ? e + (i ? v : d) : e.substr(0, r.index) + r[1] + r[2] + "$lit$" + r[3] + l
            }
            return t += this.strings[e], t
        }

        getTemplateElement() {
            const e = document.createElement("template");
            return e.innerHTML = this.getHTML(), e
        }
    }

    const w = e => null === e || !("object" == typeof e || "function" == typeof e),
        y = e => Array.isArray(e) || !(!e || !e[Symbol.iterator]);

    class x {
        constructor(e, t, i) {
            this.dirty = !0, this.element = e, this.name = t, this.strings = i, this.parts = [];
            for (let e = 0; e < i.length - 1; e++) this.parts[e] = this._createPart()
        }

        _createPart() {
            return new k(this)
        }

        _getValue() {
            const e = this.strings, t = e.length - 1;
            let i = "";
            for (let n = 0; n < t; n++) {
                i += e[n];
                const t = this.parts[n];
                if (void 0 !== t) {
                    const e = t.value;
                    if (w(e) || !y(e)) i += "string" == typeof e ? e : String(e); else for (const t of e) i += "string" == typeof t ? t : String(t)
                }
            }
            return i += e[t], i
        }

        commit() {
            this.dirty && (this.dirty = !1, this.element.setAttribute(this.name, this._getValue()))
        }
    }

    class k {
        constructor(e) {
            this.value = void 0, this.committer = e
        }

        setValue(e) {
            e === s || w(e) && e === this.value || (this.value = e, o(e) || (this.committer.dirty = !0))
        }

        commit() {
            for (; o(this.value);) {
                const e = this.value;
                this.value = s, e(this)
            }
            this.value !== s && this.committer.commit()
        }
    }

    class S {
        constructor(e) {
            this.value = void 0, this.__pendingValue = void 0, this.options = e
        }

        appendInto(e) {
            this.startNode = e.appendChild(f()), this.endNode = e.appendChild(f())
        }

        insertAfterNode(e) {
            this.startNode = e, this.endNode = e.nextSibling
        }

        appendIntoPart(e) {
            e.__insert(this.startNode = f()), e.__insert(this.endNode = f())
        }

        insertAfterPart(e) {
            e.__insert(this.startNode = f()), this.endNode = e.endNode, e.endNode = this.startNode
        }

        setValue(e) {
            this.__pendingValue = e
        }

        commit() {
            for (; o(this.__pendingValue);) {
                const e = this.__pendingValue;
                this.__pendingValue = s, e(this)
            }
            const e = this.__pendingValue;
            e !== s && (w(e) ? e !== this.value && this.__commitText(e) : e instanceof _ ? this.__commitTemplateResult(e) : e instanceof Node ? this.__commitNode(e) : y(e) ? this.__commitIterable(e) : e === c ? (this.value = c, this.clear()) : this.__commitText(e))
        }

        __insert(e) {
            this.endNode.parentNode.insertBefore(e, this.endNode)
        }

        __commitNode(e) {
            this.value !== e && (this.clear(), this.__insert(e), this.value = e)
        }

        __commitText(e) {
            const t = this.startNode.nextSibling, i = "string" == typeof (e = null == e ? "" : e) ? e : String(e);
            t === this.endNode.previousSibling && 3 === t.nodeType ? t.data = i : this.__commitNode(document.createTextNode(i)), this.value = e
        }

        __commitTemplateResult(e) {
            const t = this.options.templateFactory(e);
            if (this.value instanceof b && this.value.template === t) this.value.update(e.values); else {
                const i = new b(t, e.processor, this.options), n = i._clone();
                i.update(e.values), this.__commitNode(n), this.value = i
            }
        }

        __commitIterable(e) {
            Array.isArray(this.value) || (this.value = [], this.clear());
            const t = this.value;
            let i, n = 0;
            for (const o of e) i = t[n], void 0 === i && (i = new S(this.options), t.push(i), 0 === n ? i.appendIntoPart(this) : i.insertAfterPart(t[n - 1])), i.setValue(o), i.commit(), n++;
            n < t.length && (t.length = n, this.clear(i && i.endNode))
        }

        clear(e = this.startNode) {
            a(this.startNode.parentNode, e.nextSibling, this.endNode)
        }
    }

    class C {
        constructor(e, t, i) {
            if (this.value = void 0, this.__pendingValue = void 0, 2 !== i.length || "" !== i[0] || "" !== i[1]) throw new Error("Boolean attributes can only contain a single expression");
            this.element = e, this.name = t, this.strings = i
        }

        setValue(e) {
            this.__pendingValue = e
        }

        commit() {
            for (; o(this.__pendingValue);) {
                const e = this.__pendingValue;
                this.__pendingValue = s, e(this)
            }
            if (this.__pendingValue === s) return;
            const e = !!this.__pendingValue;
            this.value !== e && (e ? this.element.setAttribute(this.name, "") : this.element.removeAttribute(this.name), this.value = e), this.__pendingValue = s
        }
    }

    class E extends x {
        constructor(e, t, i) {
            super(e, t, i), this.single = 2 === i.length && "" === i[0] && "" === i[1]
        }

        _createPart() {
            return new T(this)
        }

        _getValue() {
            return this.single ? this.parts[0].value : super._getValue()
        }

        commit() {
            this.dirty && (this.dirty = !1, this.element[this.name] = this._getValue())
        }
    }

    class T extends k {
    }

    let M = !1;
    try {
        const e = {
            get capture() {
                return M = !0, !1
            }
        };
        window.addEventListener("test", e, e), window.removeEventListener("test", e, e)
    } catch (e) {
    }

    class P {
        constructor(e, t, i) {
            this.value = void 0, this.__pendingValue = void 0, this.element = e, this.eventName = t, this.eventContext = i, this.__boundHandleEvent = e => this.handleEvent(e)
        }

        setValue(e) {
            this.__pendingValue = e
        }

        commit() {
            for (; o(this.__pendingValue);) {
                const e = this.__pendingValue;
                this.__pendingValue = s, e(this)
            }
            if (this.__pendingValue === s) return;
            const e = this.__pendingValue, t = this.value,
                i = null == e || null != t && (e.capture !== t.capture || e.once !== t.once || e.passive !== t.passive),
                n = null != e && (null == t || i);
            i && this.element.removeEventListener(this.eventName, this.__boundHandleEvent, this.__options), n && (this.__options = D(e), this.element.addEventListener(this.eventName, this.__boundHandleEvent, this.__options)), this.value = e, this.__pendingValue = s
        }

        handleEvent(e) {
            "function" == typeof this.value ? this.value.call(this.eventContext || this.element, e) : this.value.handleEvent(e)
        }
    }

    const D = e => e && (M ? {capture: e.capture, passive: e.passive, once: e.once} : e.capture);
    const I = new class {
        handleAttributeExpressions(e, t, i, n) {
            const o = t[0];
            if ("." === o) {
                return new E(e, t.slice(1), i).parts
            }
            return "@" === o ? [new P(e, t.slice(1), n.eventContext)] : "?" === o ? [new C(e, t.slice(1), i)] : new x(e, t, i).parts
        }

        handleTextExpression(e) {
            return new S(e)
        }
    };

    function A(e) {
        let t = L.get(e.type);
        void 0 === t && (t = {stringsArray: new WeakMap, keyString: new Map}, L.set(e.type, t));
        let i = t.stringsArray.get(e.strings);
        if (void 0 !== i) return i;
        const n = e.strings.join(l);
        return i = t.keyString.get(n), void 0 === i && (i = new h(e, e.getTemplateElement()), t.keyString.set(n, i)), t.stringsArray.set(e.strings, i), i
    }

    const L = new Map, N = new WeakMap;
    (window.litHtmlVersions || (window.litHtmlVersions = [])).push("1.1.2");
    const z = (e, ...t) => new _(e, t, "html", I);

    function R(e, t) {
        const {element: {content: i}, parts: n} = e, o = document.createTreeWalker(i, 133, null, !1);
        let r = $(n), a = n[r], s = -1, c = 0;
        const l = [];
        let d = null;
        for (; o.nextNode();) {
            s++;
            const e = o.currentNode;
            for (e.previousSibling === d && (d = null), t.has(e) && (l.push(e), null === d && (d = e)), null !== d && c++; void 0 !== a && a.index === s;) a.index = null !== d ? -1 : a.index - c, r = $(n, r), a = n[r]
        }
        l.forEach(e => e.parentNode.removeChild(e))
    }

    const O = e => {
        let t = 11 === e.nodeType ? 0 : 1;
        const i = document.createTreeWalker(e, 133, null, !1);
        for (; i.nextNode();) t++;
        return t
    }, $ = (e, t = -1) => {
        for (let i = t + 1; i < e.length; i++) {
            const t = e[i];
            if (m(t)) return i
        }
        return -1
    };
    const U = (e, t) => `${e}--${t}`;
    let j = !0;
    void 0 === window.ShadyCSS ? j = !1 : void 0 === window.ShadyCSS.prepareTemplateDom && (console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."), j = !1);
    const F = e => t => {
        const i = U(t.type, e);
        let n = L.get(i);
        void 0 === n && (n = {stringsArray: new WeakMap, keyString: new Map}, L.set(i, n));
        let o = n.stringsArray.get(t.strings);
        if (void 0 !== o) return o;
        const r = t.strings.join(l);
        if (o = n.keyString.get(r), void 0 === o) {
            const i = t.getTemplateElement();
            j && window.ShadyCSS.prepareTemplateDom(i, e), o = new h(t, i), n.keyString.set(r, o)
        }
        return n.stringsArray.set(t.strings, o), o
    }, V = ["html", "svg"], H = new Set, q = (e, t, i) => {
        H.add(e);
        const n = i ? i.element : document.createElement("template"), o = t.querySelectorAll("style"), {length: r} = o;
        if (0 === r) return void window.ShadyCSS.prepareTemplateStyles(n, e);
        const a = document.createElement("style");
        for (let e = 0; e < r; e++) {
            const t = o[e];
            t.parentNode.removeChild(t), a.textContent += t.textContent
        }
        (e => {
            V.forEach(t => {
                const i = L.get(U(t, e));
                void 0 !== i && i.keyString.forEach(e => {
                    const {element: {content: t}} = e, i = new Set;
                    Array.from(t.querySelectorAll("style")).forEach(e => {
                        i.add(e)
                    }), R(e, i)
                })
            })
        })(e);
        const s = n.content;
        i ? function (e, t, i = null) {
            const {element: {content: n}, parts: o} = e;
            if (null == i) return void n.appendChild(t);
            const r = document.createTreeWalker(n, 133, null, !1);
            let a = $(o), s = 0, c = -1;
            for (; r.nextNode();) {
                for (c++, r.currentNode === i && (s = O(t), i.parentNode.insertBefore(t, i)); -1 !== a && o[a].index === c;) {
                    if (s > 0) {
                        for (; -1 !== a;) o[a].index += s, a = $(o, a);
                        return
                    }
                    a = $(o, a)
                }
            }
        }(i, a, s.firstChild) : s.insertBefore(a, s.firstChild), window.ShadyCSS.prepareTemplateStyles(n, e);
        const c = s.querySelector("style");
        if (window.ShadyCSS.nativeShadow && null !== c) t.insertBefore(c.cloneNode(!0), t.firstChild); else if (i) {
            s.insertBefore(a, s.firstChild);
            const e = new Set;
            e.add(a), R(i, e)
        }
    };
    window.JSCompiler_renameProperty = (e, t) => e;
    const B = {
            toAttribute(e, t) {
                switch (t) {
                    case Boolean:
                        return e ? "" : null;
                    case Object:
                    case Array:
                        return null == e ? e : JSON.stringify(e)
                }
                return e
            }, fromAttribute(e, t) {
                switch (t) {
                    case Boolean:
                        return null !== e;
                    case Number:
                        return null === e ? null : Number(e);
                    case Object:
                    case Array:
                        return JSON.parse(e)
                }
                return e
            }
        }, W = (e, t) => t !== e && (t == t || e == e),
        Y = {attribute: !0, type: String, converter: B, reflect: !1, hasChanged: W}, G = Promise.resolve(!0);

    class J extends HTMLElement {
        constructor() {
            super(), this._updateState = 0, this._instanceProperties = void 0, this._updatePromise = G, this._hasConnectedResolver = void 0, this._changedProperties = new Map, this._reflectingProperties = void 0, this.initialize()
        }

        static get observedAttributes() {
            this.finalize();
            const e = [];
            return this._classProperties.forEach((t, i) => {
                const n = this._attributeNameForProperty(i, t);
                void 0 !== n && (this._attributeToPropertyMap.set(n, i), e.push(n))
            }), e
        }

        static _ensureClassProperties() {
            if (!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties", this))) {
                this._classProperties = new Map;
                const e = Object.getPrototypeOf(this)._classProperties;
                void 0 !== e && e.forEach((e, t) => this._classProperties.set(t, e))
            }
        }

        static createProperty(e, t = Y) {
            if (this._ensureClassProperties(), this._classProperties.set(e, t), t.noAccessor || this.prototype.hasOwnProperty(e)) return;
            const i = "symbol" == typeof e ? Symbol() : `__${e}`;
            Object.defineProperty(this.prototype, e, {
                get() {
                    return this[i]
                }, set(t) {
                    const n = this[e];
                    this[i] = t, this._requestUpdate(e, n)
                }, configurable: !0, enumerable: !0
            })
        }

        static finalize() {
            const e = Object.getPrototypeOf(this);
            if (e.hasOwnProperty("finalized") || e.finalize(), this.finalized = !0, this._ensureClassProperties(), this._attributeToPropertyMap = new Map, this.hasOwnProperty(JSCompiler_renameProperty("properties", this))) {
                const e = this.properties,
                    t = [...Object.getOwnPropertyNames(e), ..."function" == typeof Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e) : []];
                for (const i of t) this.createProperty(i, e[i])
            }
        }

        static _attributeNameForProperty(e, t) {
            const i = t.attribute;
            return !1 === i ? void 0 : "string" == typeof i ? i : "string" == typeof e ? e.toLowerCase() : void 0
        }

        static _valueHasChanged(e, t, i = W) {
            return i(e, t)
        }

        static _propertyValueFromAttribute(e, t) {
            const i = t.type, n = t.converter || B, o = "function" == typeof n ? n : n.fromAttribute;
            return o ? o(e, i) : e
        }

        static _propertyValueToAttribute(e, t) {
            if (void 0 === t.reflect) return;
            const i = t.type, n = t.converter;
            return (n && n.toAttribute || B.toAttribute)(e, i)
        }

        initialize() {
            this._saveInstanceProperties(), this._requestUpdate()
        }

        _saveInstanceProperties() {
            this.constructor._classProperties.forEach((e, t) => {
                if (this.hasOwnProperty(t)) {
                    const e = this[t];
                    delete this[t], this._instanceProperties || (this._instanceProperties = new Map), this._instanceProperties.set(t, e)
                }
            })
        }

        _applyInstanceProperties() {
            this._instanceProperties.forEach((e, t) => this[t] = e), this._instanceProperties = void 0
        }

        connectedCallback() {
            this._updateState = 32 | this._updateState, this._hasConnectedResolver && (this._hasConnectedResolver(), this._hasConnectedResolver = void 0)
        }

        disconnectedCallback() {
        }

        attributeChangedCallback(e, t, i) {
            t !== i && this._attributeToProperty(e, i)
        }

        _propertyToAttribute(e, t, i = Y) {
            const n = this.constructor, o = n._attributeNameForProperty(e, i);
            if (void 0 !== o) {
                const e = n._propertyValueToAttribute(t, i);
                if (void 0 === e) return;
                this._updateState = 8 | this._updateState, null == e ? this.removeAttribute(o) : this.setAttribute(o, e), this._updateState = -9 & this._updateState
            }
        }

        _attributeToProperty(e, t) {
            if (8 & this._updateState) return;
            const i = this.constructor, n = i._attributeToPropertyMap.get(e);
            if (void 0 !== n) {
                const e = i._classProperties.get(n) || Y;
                this._updateState = 16 | this._updateState, this[n] = i._propertyValueFromAttribute(t, e), this._updateState = -17 & this._updateState
            }
        }

        _requestUpdate(e, t) {
            let i = !0;
            if (void 0 !== e) {
                const n = this.constructor, o = n._classProperties.get(e) || Y;
                n._valueHasChanged(this[e], t, o.hasChanged) ? (this._changedProperties.has(e) || this._changedProperties.set(e, t), !0 !== o.reflect || 16 & this._updateState || (void 0 === this._reflectingProperties && (this._reflectingProperties = new Map), this._reflectingProperties.set(e, o))) : i = !1
            }
            !this._hasRequestedUpdate && i && this._enqueueUpdate()
        }

        requestUpdate(e, t) {
            return this._requestUpdate(e, t), this.updateComplete
        }

        async _enqueueUpdate() {
            let e, t;
            this._updateState = 4 | this._updateState;
            const i = this._updatePromise;
            this._updatePromise = new Promise((i, n) => {
                e = i, t = n
            });
            try {
                await i
            } catch (e) {
            }
            this._hasConnected || await new Promise(e => this._hasConnectedResolver = e);
            try {
                const e = this.performUpdate();
                null != e && await e
            } catch (e) {
                t(e)
            }
            e(!this._hasRequestedUpdate)
        }

        get _hasConnected() {
            return 32 & this._updateState
        }

        get _hasRequestedUpdate() {
            return 4 & this._updateState
        }

        get hasUpdated() {
            return 1 & this._updateState
        }

        performUpdate() {
            this._instanceProperties && this._applyInstanceProperties();
            let e = !1;
            const t = this._changedProperties;
            try {
                e = this.shouldUpdate(t), e && this.update(t)
            } catch (t) {
                throw e = !1, t
            } finally {
                this._markUpdated()
            }
            e && (1 & this._updateState || (this._updateState = 1 | this._updateState, this.firstUpdated(t)), this.updated(t))
        }

        _markUpdated() {
            this._changedProperties = new Map, this._updateState = -5 & this._updateState
        }

        get updateComplete() {
            return this._getUpdateComplete()
        }

        _getUpdateComplete() {
            return this._updatePromise
        }

        shouldUpdate(e) {
            return !0
        }

        update(e) {
            void 0 !== this._reflectingProperties && this._reflectingProperties.size > 0 && (this._reflectingProperties.forEach((e, t) => this._propertyToAttribute(t, this[t], e)), this._reflectingProperties = void 0)
        }

        updated(e) {
        }

        firstUpdated(e) {
        }
    }

    J.finalized = !0;
    const K = "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Z = Symbol();

    class X {
        constructor(e, t) {
            if (t !== Z) throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
            this.cssText = e
        }

        get styleSheet() {
            return void 0 === this._styleSheet && (K ? (this._styleSheet = new CSSStyleSheet, this._styleSheet.replaceSync(this.cssText)) : this._styleSheet = null), this._styleSheet
        }

        toString() {
            return this.cssText
        }
    }

    const Q = e => new X(String(e), Z), ee = (e, ...t) => {
        const i = t.reduce((t, i, n) => t + (e => {
            if (e instanceof X) return e.cssText;
            if ("number" == typeof e) return e;
            throw new Error(`Value passed to 'css' function must be a 'css' function result: ${e}. Use 'unsafeCSS' to pass non-literal values, but\n            take care to ensure page security.`)
        })(i) + e[n + 1], e[0]);
        return new X(i, Z)
    };
    (window.litElementVersions || (window.litElementVersions = [])).push("2.2.1");
    const te = e => e.flat ? e.flat(1 / 0) : function e(t, i = []) {
        for (let n = 0, o = t.length; n < o; n++) {
            const o = t[n];
            Array.isArray(o) ? e(o, i) : i.push(o)
        }
        return i
    }(e);

    class ie extends J {
        static finalize() {
            super.finalize.call(this), this._styles = this.hasOwnProperty(JSCompiler_renameProperty("styles", this)) ? this._getUniqueStyles() : this._styles || []
        }

        static _getUniqueStyles() {
            const e = this.styles, t = [];
            if (Array.isArray(e)) {
                te(e).reduceRight((e, t) => (e.add(t), e), new Set).forEach(e => t.unshift(e))
            } else e && t.push(e);
            return t
        }

        initialize() {
            super.initialize(), this.renderRoot = this.createRenderRoot(), window.ShadowRoot && this.renderRoot instanceof window.ShadowRoot && this.adoptStyles()
        }

        createRenderRoot() {
            return this.attachShadow({mode: "open"})
        }

        adoptStyles() {
            const e = this.constructor._styles;
            0 !== e.length && (void 0 === window.ShadyCSS || window.ShadyCSS.nativeShadow ? K ? this.renderRoot.adoptedStyleSheets = e.map(e => e.styleSheet) : this._needsShimAdoptedStyleSheets = !0 : window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e => e.cssText), this.localName))
        }

        connectedCallback() {
            super.connectedCallback(), this.hasUpdated && void 0 !== window.ShadyCSS && window.ShadyCSS.styleElement(this)
        }

        update(e) {
            super.update(e);
            const t = this.render();
            t instanceof _ && this.constructor.render(t, this.renderRoot, {
                scopeName: this.localName,
                eventContext: this
            }), this._needsShimAdoptedStyleSheets && (this._needsShimAdoptedStyleSheets = !1, this.constructor._styles.forEach(e => {
                const t = document.createElement("style");
                t.textContent = e.cssText, this.renderRoot.appendChild(t)
            }))
        }

        render() {
        }
    }

    ie.finalized = !0, ie.render = (e, t, i) => {
        if (!i || "object" != typeof i || !i.scopeName) throw new Error("The `scopeName` option is required.");
        const n = i.scopeName, o = N.has(t), r = j && 11 === t.nodeType && !!t.host, s = r && !H.has(n),
            c = s ? document.createDocumentFragment() : t;
        if (((e, t, i) => {
            let n = N.get(t);
            void 0 === n && (a(t, t.firstChild), N.set(t, n = new S(Object.assign({templateFactory: A}, i))), n.appendInto(t)), n.setValue(e), n.commit()
        })(e, c, Object.assign({templateFactory: F(n)}, i)), s) {
            const e = N.get(c);
            N.delete(c);
            const i = e.value instanceof b ? e.value.template : void 0;
            q(n, c, i), a(t, t.firstChild), t.appendChild(c), N.set(t, e)
        }
        !o && r && window.ShadyCSS.styleElement(t.host)
    };
    const ne = e => t => class extends t {
        connectedCallback() {
            super.connectedCallback && super.connectedCallback(), this._storeUnsubscribe = e.subscribe(() => this.stateChanged(e.getState())), this.stateChanged(e.getState())
        }

        disconnectedCallback() {
            this._storeUnsubscribe(), super.disconnectedCallback && super.disconnectedCallback()
        }

        stateChanged(e) {
        }
    }, oe = {
        AWAITING_FILES: "AWAITING_FILES",
        NOT_STARTED: "NOT_STARTED",
        IN_PROGRESS: "IN_PROGRESS",
        COMPLETE: "COMPLETE",
        ERROR: "ERROR",
        DATA_ERROR: "DATA_ERROR",
        isError: function (e) {
            return e === oe.ERROR || e === oe.DATA_ERROR
        },
        isPending: function (e) {
            return e === oe.NOT_STARTED || e === oe.AWAITING_FILES || e === oe.IN_PROGRESS
        }
    };
    var re = Object.freeze(oe);
    const ae = {
        IMAGERY: "IMAGERY",
        TERRAIN: "TERRAIN",
        "3DTILES": "3DTILES",
        GLTF: "GLTF",
        CZML: "CZML",
        KML: "KML",
        GEOJSON: "GEOJSON",
        toString: function (e) {
            return e === ae.IMAGERY ? "Imagery" : e === ae.TERRAIN ? "Terrain" : e === ae.GLTF ? "glTF Model" : e === ae["3DTILES"] ? "3D Tiles" : e === ae.CZML ? "CZML" : e === ae.KML ? "KML" : e === ae.GEOJSON ? "GeoJSON" : ""
        },
        getTypes: function () {
            return Object.keys(ae).filter(e => "string" == typeof ae[e]).sort()
        }
    };
    var se = Object.freeze(ae);
    const ce = e => t => {
        t({type: "SET_ACTIVE_SLIDE_INDEX", index: e})
    }, le = e => t => {
        t({type: "SET_MODAL", modalType: e})
    }, de = e => t => {
        t({type: "SET_TRANSFORM_EDITOR_ASSET_ID", assetId: e})
    }, ue = (e, t) => i => {
        i({type: "UPDATE_ASSET_UPLOAD_PROGRESS", assetId: e, percentComplete: t})
    };
    e.Resource._ionSendJson = async function (t, i) {
        i = e.clone(i);
        let n = e.defaultValue(i.data, null);
        "object" == typeof n && (n = JSON.stringify(n)), i.data = n;
        let o = i.headers;
        e.defined(o) || (o = {}, i.headers = o), o.Accept = e.defaultValue(o.Accept, "application/json,*/*;q=0.01"), o["Content-Type"] = e.defaultValue(o["Content-Type"], "application/json");
        const r = await t(i);
        return r ? JSON.parse(r) : r
    }, e.Resource.patchJson = function (t) {
        return e.Resource._ionSendJson(e.Resource.patch, t)
    }, e.Resource.postJson = function (t) {
        return e.Resource._ionSendJson(e.Resource.post, t)
    }, e.Resource.putJson = function (t) {
        return e.Resource._ionSendJson(e.Resource.put, t)
    }, e.Resource.deleteJson = function (t) {
        return e.Resource._ionSendJson(e.Resource.delete, t)
    }, e.Resource.simpleFetch = async function (t, i) {
        return new Promise((function (n, o) {
            const r = new XMLHttpRequest;
            e.TrustedServers.contains(t) && (r.withCredentials = !0), r.open("GET", t, !0), e.defined(i) && (r.responseType = i), r.onload = function () {
                r.status < 200 || r.status >= 300 ? o(new e.RequestErrorEvent(r.status, r.response, r.getAllResponseHeaders())) : n(r)
            }, r.onerror = function () {
                o(new e.RequestErrorEvent)
            }, r.send()
        }))
    };
    const he = window.location.protocol, pe = window.location.hostname;
    let me = `api.${pe}`;
    window.location.pathname.startsWith("/dev-ion/") && (me = `dev-api.${pe}`);
    let fe = Number(window.location.port);
    (isNaN(fe) || 0 === fe) && (fe = "https:" === he ? 443 : 80), e.TrustedServers.add(me, fe), 80 !== fe && 443 !== fe && (me += ":" + fe);
    let ge = `${he}//${me}`;

    async function be(t, i) {
        return e.Resource.patchJson({url: `${ge}stories/${t}`, data: i})
    }

    async function ve() {
        return async function t(i, n) {
            const o = await e.Resource.simpleFetch(i, "json"), r = o.response,
                a = "string" == typeof r ? JSON.parse(o.response) : r;
            e.defined(n) ? n.push.apply(n, a.items) : n = a.items;
            const s = o.getResponseHeader("Link");
            if (e.defined(s)) {
                return t(s.match(/<?([^>]*)>(.*)/)[1], n)
            }
            return n
        }(ge + "v1/assets")
    }

    async function _e(t) {
        return e.Resource.fetchJson({url: `${ge}v1/assets/${t}`})
    }

    function we(e) {
        return e.story.slides.byId[e.story.slides.ids[e.app.activeSlideIndex]]
    }

    async function ye(t) {
        const i = await e.IonResource.fromAssetId(t), n = await i.fetchJson();
        let o;
        if (e.defined(n.asset.extras)) o = n.asset.extras.ion; else {
            o = {};
            const t = e.defined(n.root.transform) && !e.Matrix4.equals(n.root.transform, e.Matrix4.IDENTTIY);
            o.movable = t, o.georeferenced = t
        }
        return o
    }

    e.Ion.defaultServer = ge, ge += "/";
    let xe, ke;
    const Se = {}, Ce = {};

    function Ee(e) {
        return `No connection... retrying in ${e}`
    }

    let Te;

    async function Me(t, i, n) {
        try {
            await i(), async function (t, i) {
                clearTimeout(xe), xe = setTimeout(() => {
                    ke = Promise.resolve(ke).then(() => async function (t) {
                        return e.Resource.fetchJson({url: `${ge}stories/${t}/dateModified`})
                    }(t)).then(e => {
                        i({type: "SET_DATE_MODIFIED", dateModified: e})
                    }).finally(() => {
                        ke = void 0
                    })
                }, 500)
            }(t().story.id, n), window.hasUnsavedChanges && (window.hasUnsavedChanges = !1, Te = void 0, n({
                type: "CLOSE_NOTIFICATION",
                id: "autosaveErrorNotification"
            }))
        } catch (o) {
            if (e.defined(o.statusCode) && 404 !== o.statusCode) {
                let e = "Unexpected server error";
                if ("string" == typeof o.response) try {
                    e = JSON.parse(o.response).message
                } catch (t) {
                    e = t.response
                }
                return void n({type: "SHOW_ERROR", message: e})
            }
            if (!e.defined(Te)) {
                window.hasUnsavedChanges = !0;
                let e = 10;
                n({type: "SHOW_ERROR", id: "autosaveErrorNotification", message: Ee(e)}), Te = new Promise(t => {
                    const i = setInterval(() => {
                        e--, n({
                            type: "SHOW_ERROR",
                            id: "autosaveErrorNotification",
                            message: Ee(e)
                        }), e <= 0 && (clearInterval(i), t(), Te = void 0)
                    }, 1e3)
                })
            }
            Te = Te.then(() => Me(t, i, n))
        }
    }

    const Pe = t => async i => {
        try {
            const n = await async function (t, i) {
                let n = `${ge}stories/${t}`;
                return e.defined(i) && (n += `?access_token=${i}`), e.Resource.fetchJson({url: n})
            }(t);
            await Promise.all(n.assets.ids.map(async e => {
                const t = n.assets.byId[e];
                t.status === re.COMPLETE && t.type === se["3DTILES"] && (t.ionExtras = await ye(t.id))
            })), i({type: "SET_STORY", storyJson: n})
        } catch (t) {
            404 !== t.statusCode && e.defined(t.statusCode) ? (i({
                type: "SHOW_ERROR",
                message: "Unable to load story"
            }), console.error(t)) : window.location.replace("../../404.html")
        }
    }, De = t => async i => {
        const n = {name: "Untitled"};
        e.defined(t) && (n.assetIds = [t]);
        try {
            i({
                type: "SET_STORY", storyJson: await async function (t) {
                    return e.Resource.postJson({url: `${ge}stories`, data: t})
                }(n)
            })
        } catch (e) {
            i({type: "SHOW_ERROR", message: "Unable to create new story"}), console.error(e)
        }
    }, Ie = t => async (i, n) => {
        const o = n(), r = o.story.id, a = o.app.activeSlideIndex + 1;
        t.index = a, Me(n, async () => {
            const n = await async function (t, i) {
                return e.Resource.postJson({url: `${ge}stories/${t}/slides`, data: i})
            }(r, t);
            i({type: "ADD_SLIDE", slide: n, index: a}), i({type: "SET_ACTIVE_SLIDE_INDEX", index: a})
        }, i)
    }, Ae = (t, i) => async (n, o) => {
        clearTimeout(Se[t]);
        const r = e.defaultValue(Ce[t], {});
        Ce[t] = {...r, ...i};
        const a = o().story.id;
        Se[t] = setTimeout(async () => {
            const i = Ce[t];
            delete Ce[t], Me(o, () => async function (t, i, n) {
                return e.Resource.patchJson({url: `${ge}stories/${t}/slides/${i}`, data: n})
            }(a, t, i), n)
        }, 500), n({type: "UPDATE_SLIDE", slideId: t, options: i})
    }, Le = (t, i, n) => async (o, r) => {
        const a = `${t}-${i}`;
        clearTimeout(Se[a]);
        const s = e.defaultValue(Ce[a], {});
        Ce[a] = {...s, ...n};
        const c = r().story.id;
        Se[a] = setTimeout(() => {
            const n = Ce[a];
            delete Ce[a], Me(r, () => async function (t, i, n, o) {
                return e.Resource.patchJson({url: `${ge}stories/${t}/slides/${i}/assets/${n}`, data: o})
            }(c, t, i, n), o)
        }, 500), o({type: "UPDATE_SLIDE_ASSET_SETTINGS", slideId: t, assetId: i, assetSettings: n})
    }, Ne = t => async (i, n) => {
        const o = n().story, r = o.id;
        Me(n, async () => {
            await async function (t, i) {
                return e.Resource.deleteJson({url: `${ge}stories/${t}/slides/${i}`})
            }(r, t);
            const a = o.slides.ids.length;
            n().app.activeSlideIndex === a - 1 && i({
                type: "SET_ACTIVE_SLIDE_INDEX",
                index: Math.max(0, a - 2)
            }), i({type: "DELETE_SLIDE", slideId: t})
        }, i)
    }, ze = t => async (i, n) => {
        const o = n(), r = o.story.id;
        Me(n, async () => {
            const a = await async function (t, i) {
                return e.Resource.postJson({url: `${ge}stories/${t}/assets`, data: {assetId: i}})
            }(r, t);
            a.status === re.COMPLETE && a.type === se["3DTILES"] && (a.ionExtras = await ye(t));
            const s = o.story.slides.ids[o.app.activeSlideIndex];
            i({type: "ADD_ASSET", asset: a}), Le(s, t, {show: !0})(i, n)
        }, i)
    }, Re = t => async (i, n) => {
        const o = n().story.id;
        Me(n, async () => {
            await async function (t, i) {
                return e.Resource.deleteJson({url: `${ge}stories/${t}/assets/${i}`})
            }(o, t), i({type: "DELETE_ASSET", assetId: t})
        }, i)
    }, Oe = t => async (i, n) => {
        const o = n().story.id;
        Me(n, () => async function (t, i) {
            return e.Resource.putJson({url: `${ge}stories/${t}/shared`, data: {shared: i}})
        }(o, t), i), i({type: "SET_SHARED", shared: t})
    }, $e = t => (i, n) => {
        const o = "story";
        clearTimeout(Se[o]);
        const r = e.defaultValue(Ce[o], {});
        Ce[o] = {...r, ...t};
        const a = n().story.id;
        Se[o] = setTimeout(() => {
            const e = Ce[o];
            delete Ce[o], Me(n, () => be(a, e), i)
        }, 500), i({type: "UPDATE_STORY_METADATA", options: t})
    }, Ue = (t, i) => async (n, o) => {
        const r = we(o()).terrainAssetId;
        Me(o, async () => {
            await async function (t, i, n) {
                return e.Resource.putJson({
                    url: ge + "assets/" + t + "/transform",
                    data: {transform: e.Matrix4.toArray(i), terrainId: n}
                })
            }(t, i, r), n({
                type: "UPDATE_ASSET",
                assetId: t,
                assetMetadata: {ionExtras: {georeferenced: !0, movable: !0}}
            })
        }, n)
    };
    var je = "NONE", Fe = "ADD_ASSET", Ve = "SHARING_OPTIONS", He = "SETTINGS", qe = "THUMBNAIL", Be = "UPLOAD",
        We = "NAME_PROMPT", Ye = "EMBED_CODE";
    var Ge = function (e) {
            var t, i = e.Symbol;
            return "function" == typeof i ? i.observable ? t = i.observable : (t = i("observable"), i.observable = t) : t = "@@observable", t
        }("undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof module ? module : Function("return this")()),
        Je = function () {
            return Math.random().toString(36).substring(7).split("").join(".")
        }, Ke = {
            INIT: "@@redux/INIT" + Je(), REPLACE: "@@redux/REPLACE" + Je(), PROBE_UNKNOWN_ACTION: function () {
                return "@@redux/PROBE_UNKNOWN_ACTION" + Je()
            }
        };

    function Ze(e) {
        if ("object" != typeof e || null === e) return !1;
        for (var t = e; null !== Object.getPrototypeOf(t);) t = Object.getPrototypeOf(t);
        return Object.getPrototypeOf(e) === t
    }

    function Xe(e, t) {
        var i = t && t.type;
        return "Given " + (i && 'action "' + String(i) + '"' || "an action") + ', reducer "' + e + '" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'
    }

    function Qe(e, t, i) {
        return t in e ? Object.defineProperty(e, t, {
            value: i,
            enumerable: !0,
            configurable: !0,
            writable: !0
        }) : e[t] = i, e
    }

    function et(e, t) {
        var i = Object.keys(e);
        return Object.getOwnPropertySymbols && i.push.apply(i, Object.getOwnPropertySymbols(e)), t && (i = i.filter((function (t) {
            return Object.getOwnPropertyDescriptor(e, t).enumerable
        }))), i
    }

    function tt(e) {
        for (var t = 1; t < arguments.length; t++) {
            var i = null != arguments[t] ? arguments[t] : {};
            t % 2 ? et(i, !0).forEach((function (t) {
                Qe(e, t, i[t])
            })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i)) : et(i).forEach((function (t) {
                Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(i, t))
            }))
        }
        return e
    }

    function it() {
        for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i];
        return 0 === t.length ? function (e) {
            return e
        } : 1 === t.length ? t[0] : t.reduce((function (e, t) {
            return function () {
                return e(t.apply(void 0, arguments))
            }
        }))
    }

    function nt(e) {
        return function (t) {
            var i = t.dispatch, n = t.getState;
            return function (t) {
                return function (o) {
                    return "function" == typeof o ? o(i, n, e) : t(o)
                }
            }
        }
    }

    var ot = nt();
    ot.withExtraArgument = nt;
    var rt = "INFO", at = "SUCCESS", st = "ERROR";
    const ct = {
        modalType: je,
        pendingUploads: {},
        notifications: {byId: {}, ids: []},
        transformEditorAssetId: void 0,
        sidePanelTabsEnabled: !0,
        activeSlideIndex: 0
    }, lt = {
        id: void 0,
        name: "",
        unit: void 0,
        dateModified: void 0,
        assets: {byId: {}, ids: []},
        slides: {byId: {}, ids: []},
        shared: !1
    };
    const dt = function e(t, i, n) {
        var o;
        if ("function" == typeof i && "function" == typeof n || "function" == typeof n && "function" == typeof arguments[3]) throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");
        if ("function" == typeof i && void 0 === n && (n = i, i = void 0), void 0 !== n) {
            if ("function" != typeof n) throw new Error("Expected the enhancer to be a function.");
            return n(e)(t, i)
        }
        if ("function" != typeof t) throw new Error("Expected the reducer to be a function.");
        var r = t, a = i, s = [], c = s, l = !1;

        function d() {
            c === s && (c = s.slice())
        }

        function u() {
            if (l) throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");
            return a
        }

        function h(e) {
            if ("function" != typeof e) throw new Error("Expected the listener to be a function.");
            if (l) throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");
            var t = !0;
            return d(), c.push(e), function () {
                if (t) {
                    if (l) throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");
                    t = !1, d();
                    var i = c.indexOf(e);
                    c.splice(i, 1), s = null
                }
            }
        }

        function p(e) {
            if (!Ze(e)) throw new Error("Actions must be plain objects. Use custom middleware for async actions.");
            if (void 0 === e.type) throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');
            if (l) throw new Error("Reducers may not dispatch actions.");
            try {
                l = !0, a = r(a, e)
            } finally {
                l = !1
            }
            for (var t = s = c, i = 0; i < t.length; i++) {
                (0, t[i])()
            }
            return e
        }

        function m(e) {
            if ("function" != typeof e) throw new Error("Expected the nextReducer to be a function.");
            r = e, p({type: Ke.REPLACE})
        }

        function f() {
            var e, t = h;
            return (e = {
                subscribe: function (e) {
                    if ("object" != typeof e || null === e) throw new TypeError("Expected the observer to be an object.");

                    function i() {
                        e.next && e.next(u())
                    }

                    return i(), {unsubscribe: t(i)}
                }
            })[Ge] = function () {
                return this
            }, e
        }

        return p({type: Ke.INIT}), (o = {dispatch: p, subscribe: h, getState: u, replaceReducer: m})[Ge] = f, o
    }(function (e) {
        for (var t = Object.keys(e), i = {}, n = 0; n < t.length; n++) {
            var o = t[n];
            "function" == typeof e[o] && (i[o] = e[o])
        }
        var r, a = Object.keys(i);
        try {
            !function (e) {
                Object.keys(e).forEach((function (t) {
                    var i = e[t];
                    if (void 0 === i(void 0, {type: Ke.INIT})) throw new Error('Reducer "' + t + "\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");
                    if (void 0 === i(void 0, {type: Ke.PROBE_UNKNOWN_ACTION()})) throw new Error('Reducer "' + t + "\" returned undefined when probed with a random type. Don't try to handle " + Ke.INIT + ' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')
                }))
            }(i)
        } catch (e) {
            r = e
        }
        return function (e, t) {
            if (void 0 === e && (e = {}), r) throw r;
            for (var n = !1, o = {}, s = 0; s < a.length; s++) {
                var c = a[s], l = i[c], d = e[c], u = l(d, t);
                if (void 0 === u) {
                    var h = Xe(c, t);
                    throw new Error(h)
                }
                o[c] = u, n = n || u !== d
            }
            return (n = n || a.length !== Object.keys(e).length) ? o : e
        }
    }({
        app: (t = ct, i) => {
            switch (i.type) {
                case"SET_ACTIVE_SLIDE_INDEX":
                    return {...t, activeSlideIndex: i.index};
                case"SET_MODAL":
                    return {...t, modalType: i.modalType};
                case"SET_TRANSFORM_EDITOR_ASSET_ID":
                    return {...t, transformEditorAssetId: i.assetId};
                case"SHOW_ERROR": {
                    const n = e.defaultValue(i.id, e.createGuid());
                    let o = t.notifications.ids;
                    return -1 === o.indexOf(n) && (o = [...o, n]), {
                        ...t,
                        notifications: {
                            byId: {
                                ...t.notifications.byId,
                                [n]: {id: n, message: i.message, type: st, timeout: 0}
                            }, ids: o
                        }
                    }
                }
                case"SHOW_INFO": {
                    const n = e.defaultValue(i.id, e.createGuid());
                    let o = t.notifications.ids;
                    return -1 === o.indexOf(n) && (o = [...o, n]), {
                        ...t,
                        notifications: {
                            byId: {
                                ...t.notifications.byId,
                                [n]: {id: n, message: i.message, type: rt, timeout: 5e3}
                            }, ids: o
                        }
                    }
                }
                case"SHOW_SUCCESS": {
                    const n = e.defaultValue(i.id, e.createGuid());
                    let o = t.notifications.ids;
                    return -1 === o.indexOf(n) && (o = [...o, n]), {
                        ...t,
                        notifications: {
                            byId: {
                                ...t.notifications.byId,
                                [n]: {id: n, message: i.message, type: at, timeout: 5e3}
                            }, ids: o
                        }
                    }
                }
                case"CLOSE_NOTIFICATION": {
                    const n = t.notifications.byId[i.id];
                    return e.defined(n) ? (delete t.notifications.byId[i.id], {
                        ...t,
                        notifications: {
                            byId: {...t.notifications.byId},
                            ids: t.notifications.ids.filter(e => e !== i.id)
                        }
                    }) : t
                }
                case"UPDATE_ASSET_UPLOAD_PROGRESS":
                    return 100 === i.percentComplete ? (delete t.pendingUploads[i.assetId], {...t}) : {
                        ...t,
                        pendingUploads: {...t.pendingUploads, [i.assetId]: i.percentComplete}
                    };
                default:
                    return t
            }
        }, story: (t = lt, i) => {
            switch (i.type) {
                case"SET_STORY":
                    return {
                        ...t,
                        id: i.storyJson.id,
                        name: i.storyJson.name,
                        unit: i.storyJson.unit,
                        assets: i.storyJson.assets,
                        slides: i.storyJson.slides,
                        shared: i.storyJson.shared,
                        dateModified: i.storyJson.dateModified
                    };
                case"UPDATE_STORY_METADATA":
                    return {...t, ...i.options};
                case"SET_DATE_MODIFIED":
                    return {...t, dateModified: i.dateModified};
                case"ADD_ASSET":
                    return {
                        ...t,
                        assets: {byId: {...t.assets.byId, [i.asset.id]: i.asset}, ids: [...t.assets.ids, i.asset.id]}
                    };
                case"UPDATE_ASSET":
                    return {
                        ...t,
                        assets: {
                            byId: {
                                ...t.assets.byId,
                                [i.assetId]: {...t.assets.byId[i.assetId], ...i.assetMetadata}
                            }, ids: t.assets.ids
                        }
                    };
                case"UPDATE_ASSET_ORDER":
                    return {...t, assets: {byId: t.assets.byId, ids: i.assetIds}};
                case"DELETE_ASSET": {
                    delete t.assets.byId[i.assetId];
                    const n = function (t, i) {
                        const n = {}, o = i.byId;
                        return i.ids.forEach(i => {
                            const r = o[i], a = e.defaultValue(r.assetSettings, e.defaultValue.EMPTY_OBJECT);
                            delete a[t], n[i] = {...r, assetSettings: {...a}}
                        }), n
                    }(i.assetId, t.slides);
                    return {
                        ...t,
                        assets: {byId: {...t.assets.byId}, ids: t.assets.ids.filter(e => e !== i.assetId)},
                        slides: {byId: n, ids: t.slides.ids}
                    }
                }
                case"ADD_SLIDE": {
                    let n = t.slides.ids.slice();
                    return e.defined(i.index) ? n.splice(i.index, 0, i.slide.id) : n.push(i.slide.id), {
                        ...t,
                        slides: {byId: {...t.slides.byId, [i.slide.id]: i.slide}, ids: n}
                    }
                }
                case"UPDATE_SLIDES_ORDER":
                    return {...t, slides: {byId: t.slides.byId, ids: i.slideIds}};
                case"UPDATE_SLIDE":
                    return {
                        ...t,
                        slides: {
                            byId: {...t.slides.byId, [i.slideId]: {...t.slides.byId[i.slideId], ...i.options}},
                            ids: t.slides.ids
                        }
                    };
                case"UPDATE_SLIDE_ASSET_SETTINGS": {
                    const e = t.slides.byId[i.slideId], n = e.assetSettings[i.assetId];
                    return {
                        ...t,
                        slides: {
                            byId: {
                                ...t.slides.byId,
                                [i.slideId]: {
                                    ...e,
                                    assetSettings: {...e.assetSettings, [i.assetId]: {...n, ...i.assetSettings}}
                                }
                            }, ids: t.slides.ids
                        }
                    }
                }
                case"DELETE_SLIDE": {
                    delete t.slides.byId[i.slideId];
                    const e = t.slides.ids.filter(e => e !== i.slideId);
                    return {...t, slides: {byId: {...t.slides.byId}, ids: e}}
                }
                case"SET_SHARED":
                    return {...t, shared: i.shared};
                default:
                    return t
            }
        }
    }), function () {
        for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i];
        return function (e) {
            return function () {
                var i = e.apply(void 0, arguments), n = function () {
                    throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")
                }, o = {
                    getState: i.getState, dispatch: function () {
                        return n.apply(void 0, arguments)
                    }
                }, r = t.map((function (e) {
                    return e(o)
                }));
                return tt({}, i, {dispatch: n = it.apply(void 0, r)(i.dispatch)})
            }
        }
    }(ot));

    function ut(e, t) {
        for (var i = 0; i < t.length; i++) {
            var n = t[i];
            n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n)
        }
    }

    function ht(e, t, i) {
        return t in e ? Object.defineProperty(e, t, {
            value: i,
            enumerable: !0,
            configurable: !0,
            writable: !0
        }) : e[t] = i, e
    }

    function pt(e) {
        for (var t = 1; t < arguments.length; t++) {
            var i = null != arguments[t] ? arguments[t] : {}, n = Object.keys(i);
            "function" == typeof Object.getOwnPropertySymbols && (n = n.concat(Object.getOwnPropertySymbols(i).filter((function (e) {
                return Object.getOwnPropertyDescriptor(i, e).enumerable
            })))), n.forEach((function (t) {
                ht(e, t, i[t])
            }))
        }
        return e
    }

    function mt(e, t) {
        return function (e) {
            if (Array.isArray(e)) return e
        }(e) || function (e, t) {
            var i = [], n = !0, o = !1, r = void 0;
            try {
                for (var a, s = e[Symbol.iterator](); !(n = (a = s.next()).done) && (i.push(a.value), !t || i.length !== t); n = !0) ;
            } catch (e) {
                o = !0, r = e
            } finally {
                try {
                    n || null == s.return || s.return()
                } finally {
                    if (o) throw r
                }
            }
            return i
        }(e, t) || function () {
            throw new TypeError("Invalid attempt to destructure non-iterable instance")
        }()
    }

    var ft = function () {
    }, gt = {}, bt = {}, vt = {mark: ft, measure: ft};
    try {
        "undefined" != typeof window && (gt = window), "undefined" != typeof document && (bt = document), "undefined" != typeof MutationObserver && MutationObserver, "undefined" != typeof performance && (vt = performance)
    } catch (e) {
    }
    var _t = (gt.navigator || {}).userAgent, wt = void 0 === _t ? "" : _t, yt = gt, xt = bt, kt = vt,
        St = (yt.document, !!xt.documentElement && !!xt.head && "function" == typeof xt.addEventListener && "function" == typeof xt.createElement),
        Ct = (~wt.indexOf("MSIE") || wt.indexOf("Trident/"), function () {
            try {
            } catch (e) {
                return !1
            }
        }(), "group"), Et = "primary", Tt = "secondary", Mt = yt.FontAwesomeConfig || {};
    if (xt && "function" == typeof xt.querySelector) {
        [["data-family-prefix", "familyPrefix"], ["data-replacement-class", "replacementClass"], ["data-auto-replace-svg", "autoReplaceSvg"], ["data-auto-add-css", "autoAddCss"], ["data-auto-a11y", "autoA11y"], ["data-search-pseudo-elements", "searchPseudoElements"], ["data-observe-mutations", "observeMutations"], ["data-mutate-approach", "mutateApproach"], ["data-keep-original-source", "keepOriginalSource"], ["data-measure-performance", "measurePerformance"], ["data-show-missing-icons", "showMissingIcons"]].forEach((function (e) {
            var t = mt(e, 2), i = t[0], n = t[1], o = function (e) {
                return "" === e || "false" !== e && ("true" === e || e)
            }(function (e) {
                var t = xt.querySelector("script[" + e + "]");
                if (t) return t.getAttribute(e)
            }(i));
            null != o && (Mt[n] = o)
        }))
    }
    var Pt = pt({}, {
        familyPrefix: "fa",
        replacementClass: "svg-inline--fa",
        autoReplaceSvg: !0,
        autoAddCss: !0,
        autoA11y: !0,
        searchPseudoElements: !1,
        observeMutations: !0,
        mutateApproach: "async",
        keepOriginalSource: !0,
        measurePerformance: !1,
        showMissingIcons: !0
    }, Mt);
    Pt.autoReplaceSvg || (Pt.observeMutations = !1);
    var Dt = pt({}, Pt);
    yt.FontAwesomeConfig = Dt;
    var It = yt || {};
    It.___FONT_AWESOME___ || (It.___FONT_AWESOME___ = {}), It.___FONT_AWESOME___.styles || (It.___FONT_AWESOME___.styles = {}), It.___FONT_AWESOME___.hooks || (It.___FONT_AWESOME___.hooks = {}), It.___FONT_AWESOME___.shims || (It.___FONT_AWESOME___.shims = []);
    var At = It.___FONT_AWESOME___, Lt = [];
    St && ((xt.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(xt.readyState) || xt.addEventListener("DOMContentLoaded", (function e() {
        xt.removeEventListener("DOMContentLoaded", e), 1, Lt.map((function (e) {
            return e()
        }))
    })));
    "undefined" != typeof global && void 0 !== global.process && global.process.emit, "undefined" == typeof setImmediate ? setTimeout : setImmediate;
    var Nt = {size: 16, x: 0, y: 0, rotate: 0, flipX: !1, flipY: !1};

    function zt() {
        for (var e = 12, t = ""; e-- > 0;) t += "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[62 * Math.random() | 0];
        return t
    }

    function Rt(e) {
        return "".concat(e).replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;")
    }

    function Ot(e) {
        return Object.keys(e || {}).reduce((function (t, i) {
            return t + "".concat(i, ": ").concat(e[i], ";")
        }), "")
    }

    function $t(e) {
        return e.size !== Nt.size || e.x !== Nt.x || e.y !== Nt.y || e.rotate !== Nt.rotate || e.flipX || e.flipY
    }

    function Ut(e) {
        var t = e.transform, i = e.containerWidth, n = e.iconWidth,
            o = {transform: "translate(".concat(i / 2, " 256)")},
            r = "translate(".concat(32 * t.x, ", ").concat(32 * t.y, ") "),
            a = "scale(".concat(t.size / 16 * (t.flipX ? -1 : 1), ", ").concat(t.size / 16 * (t.flipY ? -1 : 1), ") "),
            s = "rotate(".concat(t.rotate, " 0 0)");
        return {
            outer: o,
            inner: {transform: "".concat(r, " ").concat(a, " ").concat(s)},
            path: {transform: "translate(".concat(n / 2 * -1, " -256)")}
        }
    }

    var jt = {x: 0, y: 0, width: "100%", height: "100%"};

    function Ft(e) {
        var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];
        return e.attributes && (e.attributes.fill || t) && (e.attributes.fill = "black"), e
    }

    function Vt(e) {
        var t = e.icons, i = t.main, n = t.mask, o = e.prefix, r = e.iconName, a = e.transform, s = e.symbol,
            c = e.title, l = e.extra, d = e.watchable, u = void 0 !== d && d, h = n.found ? n : i, p = h.width,
            m = h.height, f = "fa-w-".concat(Math.ceil(p / m * 16)),
            g = [Dt.replacementClass, r ? "".concat(Dt.familyPrefix, "-").concat(r) : "", f].filter((function (e) {
                return -1 === l.classes.indexOf(e)
            })).concat(l.classes).join(" "), b = {
                children: [],
                attributes: pt({}, l.attributes, {
                    "data-prefix": o,
                    "data-icon": r,
                    class: g,
                    role: l.attributes.role || "img",
                    xmlns: "http://www.w3.org/2000/svg",
                    viewBox: "0 0 ".concat(p, " ").concat(m)
                })
            };
        u && (b.attributes["data-fa-i2svg"] = ""), c && b.children.push({
            tag: "title",
            attributes: {id: b.attributes["aria-labelledby"] || "title-".concat(zt())},
            children: [c]
        });
        var v = pt({}, b, {prefix: o, iconName: r, main: i, mask: n, transform: a, symbol: s, styles: l.styles}),
            _ = n.found && i.found ? function (e) {
                var t, i = e.children, n = e.attributes, o = e.main, r = e.mask, a = e.transform, s = o.width,
                    c = o.icon, l = r.width, d = r.icon, u = Ut({transform: a, containerWidth: l, iconWidth: s}),
                    h = {tag: "rect", attributes: pt({}, jt, {fill: "white"})},
                    p = c.children ? {children: c.children.map(Ft)} : {}, m = {
                        tag: "g",
                        attributes: pt({}, u.inner),
                        children: [Ft(pt({tag: c.tag, attributes: pt({}, c.attributes, u.path)}, p))]
                    }, f = {tag: "g", attributes: pt({}, u.outer), children: [m]}, g = "mask-".concat(zt()),
                    b = "clip-".concat(zt()), v = {
                        tag: "mask",
                        attributes: pt({}, jt, {id: g, maskUnits: "userSpaceOnUse", maskContentUnits: "userSpaceOnUse"}),
                        children: [h, f]
                    }, _ = {
                        tag: "defs",
                        children: [{
                            tag: "clipPath",
                            attributes: {id: b},
                            children: (t = d, "g" === t.tag ? t.children : [t])
                        }, v]
                    };
                return i.push(_, {
                    tag: "rect",
                    attributes: pt({
                        fill: "currentColor",
                        "clip-path": "url(#".concat(b, ")"),
                        mask: "url(#".concat(g, ")")
                    }, jt)
                }), {children: i, attributes: n}
            }(v) : function (e) {
                var t = e.children, i = e.attributes, n = e.main, o = e.transform, r = Ot(e.styles);
                if (r.length > 0 && (i.style = r), $t(o)) {
                    var a = Ut({transform: o, containerWidth: n.width, iconWidth: n.width});
                    t.push({
                        tag: "g",
                        attributes: pt({}, a.outer),
                        children: [{
                            tag: "g",
                            attributes: pt({}, a.inner),
                            children: [{
                                tag: n.icon.tag,
                                children: n.icon.children,
                                attributes: pt({}, n.icon.attributes, a.path)
                            }]
                        }]
                    })
                } else t.push(n.icon);
                return {children: t, attributes: i}
            }(v), w = _.children, y = _.attributes;
        return v.children = w, v.attributes = y, s ? function (e) {
            var t = e.prefix, i = e.iconName, n = e.children, o = e.attributes, r = e.symbol;
            return [{
                tag: "svg",
                attributes: {style: "display: none;"},
                children: [{
                    tag: "symbol",
                    attributes: pt({}, o, {id: !0 === r ? "".concat(t, "-").concat(Dt.familyPrefix, "-").concat(i) : r}),
                    children: n
                }]
            }]
        }(v) : function (e) {
            var t = e.children, i = e.main, n = e.mask, o = e.attributes, r = e.styles, a = e.transform;
            if ($t(a) && i.found && !n.found) {
                var s = {x: i.width / i.height / 2, y: .5};
                o.style = Ot(pt({}, r, {"transform-origin": "".concat(s.x + a.x / 16, "em ").concat(s.y + a.y / 16, "em")}))
            }
            return [{tag: "svg", attributes: o, children: t}]
        }(v)
    }

    var Ht = function () {
    }, qt = (Dt.measurePerformance && kt && kt.mark && kt.measure, function (e, t, i, n) {
        var o, r, a, s = Object.keys(e), c = s.length, l = void 0 !== n ? function (e, t) {
            return function (i, n, o, r) {
                return e.call(t, i, n, o, r)
            }
        }(t, n) : t;
        for (void 0 === i ? (o = 1, a = e[s[0]]) : (o = 0, a = i); o < c; o++) a = l(a, e[r = s[o]], r, e);
        return a
    });

    function Bt(e, t) {
        var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, n = i.skipHooks,
            o = void 0 !== n && n, r = Object.keys(t).reduce((function (e, i) {
                var n = t[i];
                return !!n.icon ? e[n.iconName] = n.icon : e[i] = n, e
            }), {});
        "function" != typeof At.hooks.addPack || o ? At.styles[e] = pt({}, At.styles[e] || {}, r) : At.hooks.addPack(e, r), "fas" === e && Bt("fa", t)
    }

    var Wt = At.styles, Yt = At.shims, Gt = function () {
        var e = function (e) {
            return qt(Wt, (function (t, i, n) {
                return t[n] = qt(i, e, {}), t
            }), {})
        };
        e((function (e, t, i) {
            return t[3] && (e[t[3]] = i), e
        })), e((function (e, t, i) {
            var n = t[2];
            return e[i] = i, n.forEach((function (t) {
                e[t] = i
            })), e
        }));
        var t = "far" in Wt;
        qt(Yt, (function (e, i) {
            var n = i[0], o = i[1], r = i[2];
            return "far" !== o || t || (o = "fas"), e[n] = {prefix: o, iconName: r}, e
        }), {})
    };
    Gt();
    At.styles;

    function Jt(e, t, i) {
        if (e && e[t] && e[t][i]) return {prefix: t, iconName: i, icon: e[t][i]}
    }

    function Kt(e) {
        var t = e.tag, i = e.attributes, n = void 0 === i ? {} : i, o = e.children, r = void 0 === o ? [] : o;
        return "string" == typeof e ? Rt(e) : "<".concat(t, " ").concat(function (e) {
            return Object.keys(e || {}).reduce((function (t, i) {
                return t + "".concat(i, '="').concat(Rt(e[i]), '" ')
            }), "").trim()
        }(n), ">").concat(r.map(Kt).join(""), "</").concat(t, ">")
    }

    function Zt(e) {
        this.name = "MissingIcon", this.message = e || "Icon unavailable", this.stack = (new Error).stack
    }

    Zt.prototype = Object.create(Error.prototype), Zt.prototype.constructor = Zt;
    var Xt = {fill: "currentColor"}, Qt = {attributeType: "XML", repeatCount: "indefinite", dur: "2s"},
        ei = (pt({}, Xt, {d: "M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"}), pt({}, Qt, {attributeName: "opacity"}));
    pt({}, Xt, {cx: "256", cy: "364", r: "28"}), pt({}, Qt, {
        attributeName: "r",
        values: "28;14;28;28;14;28;"
    }), pt({}, ei, {values: "1;0;1;1;0;1;"}), pt({}, Xt, {
        opacity: "1",
        d: "M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"
    }), pt({}, ei, {values: "1;0;0;0;0;1;"}), pt({}, Xt, {
        opacity: "0",
        d: "M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"
    }), pt({}, ei, {values: "0;0;1;1;0;0;"}), At.styles;

    function ti(e) {
        var t = e[0], i = e[1], n = mt(e.slice(4), 1)[0];
        return {
            found: !0,
            width: t,
            height: i,
            icon: Array.isArray(n) ? {
                tag: "g",
                attributes: {class: "".concat(Dt.familyPrefix, "-").concat(Ct)},
                children: [{
                    tag: "path",
                    attributes: {class: "".concat(Dt.familyPrefix, "-").concat(Tt), fill: "currentColor", d: n[0]}
                }, {
                    tag: "path",
                    attributes: {class: "".concat(Dt.familyPrefix, "-").concat(Et), fill: "currentColor", d: n[1]}
                }]
            } : {tag: "path", attributes: {fill: "currentColor", d: n}}
        }
    }

    At.styles;

    function ii() {
        Dt.autoAddCss && !si && (!function (e) {
            if (e && St) {
                var t = xt.createElement("style");
                t.setAttribute("type", "text/css"), t.innerHTML = e;
                for (var i = xt.head.childNodes, n = null, o = i.length - 1; o > -1; o--) {
                    var r = i[o], a = (r.tagName || "").toUpperCase();
                    ["STYLE", "LINK"].indexOf(a) > -1 && (n = r)
                }
                xt.head.insertBefore(t, n)
            }
        }(function () {
            var e = "svg-inline--fa", t = Dt.familyPrefix, i = Dt.replacementClass,
                n = 'svg:not(:root).svg-inline--fa {\n  overflow: visible;\n}\n\n.svg-inline--fa {\n  display: inline-block;\n  font-size: inherit;\n  height: 1em;\n  overflow: visible;\n  vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-lg {\n  vertical-align: -0.225em;\n}\n.svg-inline--fa.fa-w-1 {\n  width: 0.0625em;\n}\n.svg-inline--fa.fa-w-2 {\n  width: 0.125em;\n}\n.svg-inline--fa.fa-w-3 {\n  width: 0.1875em;\n}\n.svg-inline--fa.fa-w-4 {\n  width: 0.25em;\n}\n.svg-inline--fa.fa-w-5 {\n  width: 0.3125em;\n}\n.svg-inline--fa.fa-w-6 {\n  width: 0.375em;\n}\n.svg-inline--fa.fa-w-7 {\n  width: 0.4375em;\n}\n.svg-inline--fa.fa-w-8 {\n  width: 0.5em;\n}\n.svg-inline--fa.fa-w-9 {\n  width: 0.5625em;\n}\n.svg-inline--fa.fa-w-10 {\n  width: 0.625em;\n}\n.svg-inline--fa.fa-w-11 {\n  width: 0.6875em;\n}\n.svg-inline--fa.fa-w-12 {\n  width: 0.75em;\n}\n.svg-inline--fa.fa-w-13 {\n  width: 0.8125em;\n}\n.svg-inline--fa.fa-w-14 {\n  width: 0.875em;\n}\n.svg-inline--fa.fa-w-15 {\n  width: 0.9375em;\n}\n.svg-inline--fa.fa-w-16 {\n  width: 1em;\n}\n.svg-inline--fa.fa-w-17 {\n  width: 1.0625em;\n}\n.svg-inline--fa.fa-w-18 {\n  width: 1.125em;\n}\n.svg-inline--fa.fa-w-19 {\n  width: 1.1875em;\n}\n.svg-inline--fa.fa-w-20 {\n  width: 1.25em;\n}\n.svg-inline--fa.fa-pull-left {\n  margin-right: 0.3em;\n  width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n  margin-left: 0.3em;\n  width: auto;\n}\n.svg-inline--fa.fa-border {\n  height: 1.5em;\n}\n.svg-inline--fa.fa-li {\n  width: 2em;\n}\n.svg-inline--fa.fa-fw {\n  width: 1.25em;\n}\n\n.fa-layers svg.svg-inline--fa {\n  bottom: 0;\n  left: 0;\n  margin: auto;\n  position: absolute;\n  right: 0;\n  top: 0;\n}\n\n.fa-layers {\n  display: inline-block;\n  height: 1em;\n  position: relative;\n  text-align: center;\n  vertical-align: -0.125em;\n  width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n  -webkit-transform-origin: center center;\n          transform-origin: center center;\n}\n\n.fa-layers-counter, .fa-layers-text {\n  display: inline-block;\n  position: absolute;\n  text-align: center;\n}\n\n.fa-layers-text {\n  left: 50%;\n  top: 50%;\n  -webkit-transform: translate(-50%, -50%);\n          transform: translate(-50%, -50%);\n  -webkit-transform-origin: center center;\n          transform-origin: center center;\n}\n\n.fa-layers-counter {\n  background-color: #ff253a;\n  border-radius: 1em;\n  -webkit-box-sizing: border-box;\n          box-sizing: border-box;\n  color: #fff;\n  height: 1.5em;\n  line-height: 1;\n  max-width: 5em;\n  min-width: 1.5em;\n  overflow: hidden;\n  padding: 0.25em;\n  right: 0;\n  text-overflow: ellipsis;\n  top: 0;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: top right;\n          transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n  bottom: 0;\n  right: 0;\n  top: auto;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: bottom right;\n          transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n  bottom: 0;\n  left: 0;\n  right: auto;\n  top: auto;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: bottom left;\n          transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n  right: 0;\n  top: 0;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: top right;\n          transform-origin: top right;\n}\n\n.fa-layers-top-left {\n  left: 0;\n  right: auto;\n  top: 0;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: top left;\n          transform-origin: top left;\n}\n\n.fa-lg {\n  font-size: 1.3333333333em;\n  line-height: 0.75em;\n  vertical-align: -0.0667em;\n}\n\n.fa-xs {\n  font-size: 0.75em;\n}\n\n.fa-sm {\n  font-size: 0.875em;\n}\n\n.fa-1x {\n  font-size: 1em;\n}\n\n.fa-2x {\n  font-size: 2em;\n}\n\n.fa-3x {\n  font-size: 3em;\n}\n\n.fa-4x {\n  font-size: 4em;\n}\n\n.fa-5x {\n  font-size: 5em;\n}\n\n.fa-6x {\n  font-size: 6em;\n}\n\n.fa-7x {\n  font-size: 7em;\n}\n\n.fa-8x {\n  font-size: 8em;\n}\n\n.fa-9x {\n  font-size: 9em;\n}\n\n.fa-10x {\n  font-size: 10em;\n}\n\n.fa-fw {\n  text-align: center;\n  width: 1.25em;\n}\n\n.fa-ul {\n  list-style-type: none;\n  margin-left: 2.5em;\n  padding-left: 0;\n}\n.fa-ul > li {\n  position: relative;\n}\n\n.fa-li {\n  left: -2em;\n  position: absolute;\n  text-align: center;\n  width: 2em;\n  line-height: inherit;\n}\n\n.fa-border {\n  border: solid 0.08em #eee;\n  border-radius: 0.1em;\n  padding: 0.2em 0.25em 0.15em;\n}\n\n.fa-pull-left {\n  float: left;\n}\n\n.fa-pull-right {\n  float: right;\n}\n\n.fa.fa-pull-left,\n.fas.fa-pull-left,\n.far.fa-pull-left,\n.fal.fa-pull-left,\n.fab.fa-pull-left {\n  margin-right: 0.3em;\n}\n.fa.fa-pull-right,\n.fas.fa-pull-right,\n.far.fa-pull-right,\n.fal.fa-pull-right,\n.fab.fa-pull-right {\n  margin-left: 0.3em;\n}\n\n.fa-spin {\n  -webkit-animation: fa-spin 2s infinite linear;\n          animation: fa-spin 2s infinite linear;\n}\n\n.fa-pulse {\n  -webkit-animation: fa-spin 1s infinite steps(8);\n          animation: fa-spin 1s infinite steps(8);\n}\n\n@-webkit-keyframes fa-spin {\n  0% {\n    -webkit-transform: rotate(0deg);\n            transform: rotate(0deg);\n  }\n  100% {\n    -webkit-transform: rotate(360deg);\n            transform: rotate(360deg);\n  }\n}\n\n@keyframes fa-spin {\n  0% {\n    -webkit-transform: rotate(0deg);\n            transform: rotate(0deg);\n  }\n  100% {\n    -webkit-transform: rotate(360deg);\n            transform: rotate(360deg);\n  }\n}\n.fa-rotate-90 {\n  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";\n  -webkit-transform: rotate(90deg);\n          transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";\n  -webkit-transform: rotate(180deg);\n          transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";\n  -webkit-transform: rotate(270deg);\n          transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";\n  -webkit-transform: scale(-1, 1);\n          transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n  -webkit-transform: scale(1, -1);\n          transform: scale(1, -1);\n}\n\n.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical {\n  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n  -webkit-transform: scale(-1, -1);\n          transform: scale(-1, -1);\n}\n\n:root .fa-rotate-90,\n:root .fa-rotate-180,\n:root .fa-rotate-270,\n:root .fa-flip-horizontal,\n:root .fa-flip-vertical,\n:root .fa-flip-both {\n  -webkit-filter: none;\n          filter: none;\n}\n\n.fa-stack {\n  display: inline-block;\n  height: 2em;\n  position: relative;\n  width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n  bottom: 0;\n  left: 0;\n  margin: auto;\n  position: absolute;\n  right: 0;\n  top: 0;\n}\n\n.svg-inline--fa.fa-stack-1x {\n  height: 1em;\n  width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n  height: 2em;\n  width: 2.5em;\n}\n\n.fa-inverse {\n  color: #fff;\n}\n\n.sr-only {\n  border: 0;\n  clip: rect(0, 0, 0, 0);\n  height: 1px;\n  margin: -1px;\n  overflow: hidden;\n  padding: 0;\n  position: absolute;\n  width: 1px;\n}\n\n.sr-only-focusable:active, .sr-only-focusable:focus {\n  clip: auto;\n  height: auto;\n  margin: 0;\n  overflow: visible;\n  position: static;\n  width: auto;\n}\n\n.svg-inline--fa .fa-primary {\n  fill: var(--fa-primary-color, currentColor);\n  opacity: 1;\n  opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n  fill: var(--fa-secondary-color, currentColor);\n  opacity: 0.4;\n  opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n  opacity: 0.4;\n  opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n  opacity: 1;\n  opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n  fill: black;\n}\n\n.fad.fa-inverse {\n  color: #fff;\n}';
            if ("fa" !== t || i !== e) {
                var o = new RegExp("\\.".concat("fa", "\\-"), "g"), r = new RegExp("\\--".concat("fa", "\\-"), "g"),
                    a = new RegExp("\\.".concat(e), "g");
                n = n.replace(o, ".".concat(t, "-")).replace(r, "--".concat(t, "-")).replace(a, ".".concat(i))
            }
            return n
        }()), si = !0)
    }

    function ni(e, t) {
        return Object.defineProperty(e, "abstract", {get: t}), Object.defineProperty(e, "html", {
            get: function () {
                return e.abstract.map((function (e) {
                    return Kt(e)
                }))
            }
        }), Object.defineProperty(e, "node", {
            get: function () {
                if (St) {
                    var t = xt.createElement("div");
                    return t.innerHTML = e.html, t.children
                }
            }
        }), e
    }

    function oi(e) {
        var t = e.prefix, i = void 0 === t ? "fa" : t, n = e.iconName;
        if (n) return Jt(ai.definitions, i, n) || Jt(At.styles, i, n)
    }

    var ri, ai = new (function () {
        function e() {
            !function (e, t) {
                if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
            }(this, e), this.definitions = {}
        }

        var t, i, n;
        return t = e, (i = [{
            key: "add", value: function () {
                for (var e = this, t = arguments.length, i = new Array(t), n = 0; n < t; n++) i[n] = arguments[n];
                var o = i.reduce(this._pullDefinitions, {});
                Object.keys(o).forEach((function (t) {
                    e.definitions[t] = pt({}, e.definitions[t] || {}, o[t]), Bt(t, o[t]), Gt()
                }))
            }
        }, {
            key: "reset", value: function () {
                this.definitions = {}
            }
        }, {
            key: "_pullDefinitions", value: function (e, t) {
                var i = t.prefix && t.iconName && t.icon ? {0: t} : t;
                return Object.keys(i).map((function (t) {
                    var n = i[t], o = n.prefix, r = n.iconName, a = n.icon;
                    e[o] || (e[o] = {}), e[o][r] = a
                })), e
            }
        }]) && ut(t.prototype, i), n && ut(t, n), e
    }()), si = !1, ci = (ri = function (e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, i = t.transform,
            n = void 0 === i ? Nt : i, o = t.symbol, r = void 0 !== o && o, a = t.mask, s = void 0 === a ? null : a,
            c = t.title, l = void 0 === c ? null : c, d = t.classes, u = void 0 === d ? [] : d, h = t.attributes,
            p = void 0 === h ? {} : h, m = t.styles, f = void 0 === m ? {} : m;
        if (e) {
            var g = e.prefix, b = e.iconName, v = e.icon;
            return ni(pt({type: "icon"}, e), (function () {
                return ii(), Dt.autoA11y && (l ? p["aria-labelledby"] = "".concat(Dt.replacementClass, "-title-").concat(zt()) : (p["aria-hidden"] = "true", p.focusable = "false")), Vt({
                    icons: {
                        main: ti(v),
                        mask: s ? ti(s.icon) : {found: !1, width: null, height: null, icon: {}}
                    },
                    prefix: g,
                    iconName: b,
                    transform: pt({}, Nt, n),
                    symbol: r,
                    title: l,
                    extra: {attributes: p, styles: f, classes: u}
                })
            }))
        }
    }, function (e) {
        var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
            i = (e || {}).icon ? e : oi(e || {}), n = t.mask;
        return n && (n = (n || {}).icon ? n : oi(n || {})), ri(i, pt({}, t, {mask: n}))
    });
    ai.add({
        prefix: "fas",
        iconName: "upload",
        icon: [512, 512, [], "f093", "M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"]
    }), ai.add({
        prefix: "fas",
        iconName: "spinner",
        icon: [512, 512, [], "f110", "M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"]
    }), ai.add({
        prefix: "fas",
        iconName: "arrow-circle-left",
        icon: [512, 512, [], "f0a8", "M256 504C119 504 8 393 8 256S119 8 256 8s248 111 248 248-111 248-248 248zm28.9-143.6L209.4 288H392c13.3 0 24-10.7 24-24v-16c0-13.3-10.7-24-24-24H209.4l75.5-72.4c9.7-9.3 9.9-24.8.4-34.3l-11-10.9c-9.4-9.4-24.6-9.4-33.9 0L107.7 239c-9.4 9.4-9.4 24.6 0 33.9l132.7 132.7c9.4 9.4 24.6 9.4 33.9 0l11-10.9c9.5-9.5 9.3-25-.4-34.3z"]
    }), ai.add({
        prefix: "fas",
        iconName: "arrow-circle-right",
        icon: [512, 512, [], "f0a9", "M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zm-28.9 143.6l75.5 72.4H120c-13.3 0-24 10.7-24 24v16c0 13.3 10.7 24 24 24h182.6l-75.5 72.4c-9.7 9.3-9.9 24.8-.4 34.3l11 10.9c9.4 9.4 24.6 9.4 33.9 0L404.3 273c9.4-9.4 9.4-24.6 0-33.9L271.6 106.3c-9.4-9.4-24.6-9.4-33.9 0l-11 10.9c-9.5 9.6-9.3 25.1.4 34.4z"]
    }), ai.add({
        prefix: "fas",
        iconName: "share",
        icon: [512, 512, [], "f064", "M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"]
    }), ai.add({
        prefix: "far",
        iconName: "clipboard",
        icon: [384, 512, [], "f328", "M336 64h-80c0-35.3-28.7-64-64-64s-64 28.7-64 64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM192 40c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zm144 418c0 3.3-2.7 6-6 6H54c-3.3 0-6-2.7-6-6V118c0-3.3 2.7-6 6-6h42v36c0 6.6 5.4 12 12 12h168c6.6 0 12-5.4 12-12v-36h42c3.3 0 6 2.7 6 6z"]
    }), ai.add({
        prefix: "fas",
        iconName: "search-plus",
        icon: [512, 512, [], "f00e", "M304 192v32c0 6.6-5.4 12-12 12h-56v56c0 6.6-5.4 12-12 12h-32c-6.6 0-12-5.4-12-12v-56h-56c-6.6 0-12-5.4-12-12v-32c0-6.6 5.4-12 12-12h56v-56c0-6.6 5.4-12 12-12h32c6.6 0 12 5.4 12 12v56h56c6.6 0 12 5.4 12 12zm201 284.7L476.7 505c-9.4 9.4-24.6 9.4-33.9 0L343 405.3c-4.5-4.5-7-10.6-7-17V372c-35.3 27.6-79.7 44-128 44C93.1 416 0 322.9 0 208S93.1 0 208 0s208 93.1 208 208c0 48.3-16.4 92.7-44 128h16.3c6.4 0 12.5 2.5 17 7l99.7 99.7c9.3 9.4 9.3 24.6 0 34zM344 208c0-75.2-60.8-136-136-136S72 132.8 72 208s60.8 136 136 136 136-60.8 136-136z"]
    }), ai.add({
        prefix: "fas",
        iconName: "trash-alt",
        icon: [448, 512, [], "f2ed", "M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"]
    }), ai.add({
        prefix: "fas",
        iconName: "exclamation-triangle",
        icon: [576, 512, [], "f071", "M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"]
    }), ai.add({
        prefix: "fas",
        iconName: "external-link-alt",
        icon: [512, 512, [], "f35d", "M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z"]
    }), ai.add({
        prefix: "far",
        iconName: "square",
        icon: [448, 512, [], "f0c8", "M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-6 400H54c-3.3 0-6-2.7-6-6V86c0-3.3 2.7-6 6-6h340c3.3 0 6 2.7 6 6v340c0 3.3-2.7 6-6 6z"]
    }), ai.add({
        prefix: "far",
        iconName: "check-square",
        icon: [448, 512, [], "f14a", "M400 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zm0 400H48V80h352v352zm-35.864-241.724L191.547 361.48c-4.705 4.667-12.303 4.637-16.97-.068l-90.781-91.516c-4.667-4.705-4.637-12.303.069-16.971l22.719-22.536c4.705-4.667 12.303-4.637 16.97.069l59.792 60.277 141.352-140.216c4.705-4.667 12.303-4.637 16.97.068l22.536 22.718c4.667 4.706 4.637 12.304-.068 16.971z"]
    }), ai.add({
        prefix: "fas",
        iconName: "pencil-alt",
        icon: [512, 512, [], "f303", "M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z"]
    }), ai.add({
        prefix: "fas",
        iconName: "check-circle",
        icon: [512, 512, [], "f058", "M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"]
    }), ai.add({
        prefix: "fas",
        iconName: "info-circle",
        icon: [512, 512, [], "f05a", "M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"]
    }), ai.add({
        prefix: "fas",
        iconName: "grip-vertical",
        icon: [320, 512, [], "f58e", "M96 32H32C14.33 32 0 46.33 0 64v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32V64c0-17.67-14.33-32-32-32zm0 160H32c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zm0 160H32c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zM288 32h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32V64c0-17.67-14.33-32-32-32zm0 160h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zm0 160h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32z"]
    }), ai.add({
        prefix: "fas",
        iconName: "times",
        icon: [352, 512, [], "f00d", "M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"]
    }), ai.add({
        prefix: "fas",
        iconName: "play",
        icon: [448, 512, [], "f04b", "M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"]
    }), ai.add({
        prefix: "fas",
        iconName: "play-circle",
        icon: [512, 512, [], "f144", "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z"]
    }), ai.add({
        prefix: "fas",
        iconName: "pause",
        icon: [448, 512, [], "f04c", "M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"]
    }), ai.add({
        prefix: "fas",
        iconName: "pause-circle",
        icon: [512, 512, [], "f28b", "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm-16 328c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16v160zm112 0c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16v160z"]
    }), ai.add({
        prefix: "fas",
        iconName: "cog",
        icon: [512, 512, [], "f013", "M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"]
    }), ai.add({
        prefix: "fas",
        iconName: "plus-circle",
        icon: [512, 512, [], "f055", "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"]
    }), ai.add({
        prefix: "fas",
        iconName: "list",
        icon: [512, 512, [], "f03a", "M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z"]
    }), ai.add({
        prefix: "fas",
        iconName: "chevron-right",
        icon: [320, 512, [], "f054", "M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"]
    }), ai.add({
        prefix: "fas",
        iconName: "chevron-left",
        icon: [320, 512, [], "f053", "M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"]
    }), ai.add({
        prefix: "fas",
        iconName: "tv",
        icon: [640, 512, [], "f26c", "M592 0H48A48 48 0 0 0 0 48v320a48 48 0 0 0 48 48h240v32H112a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16H352v-32h240a48 48 0 0 0 48-48V48a48 48 0 0 0-48-48zm-16 352H64V64h512z"]
    }), ai.add({
        prefix: "fas",
        iconName: "camera",
        icon: [512, 512, [], "f030", "M512 144v288c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V144c0-26.5 21.5-48 48-48h88l12.3-32.9c7-18.7 24.9-31.1 44.9-31.1h125.5c20 0 37.9 12.4 44.9 31.1L376 96h88c26.5 0 48 21.5 48 48zM376 288c0-66.2-53.8-120-120-120s-120 53.8-120 120 53.8 120 120 120 120-53.8 120-120zm-32 0c0 48.5-39.5 88-88 88s-88-39.5-88-88 39.5-88 88-88 88 39.5 88 88z"]
    }), ai.add({
        prefix: "fas",
        iconName: "ellipsis-v",
        icon: [192, 512, [], "f142", "M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z"]
    }), ai.add({
        prefix: "fas",
        iconName: "code",
        icon: [640, 512, [], "f121", "M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"]
    }), ai.add({
        prefix: "fab",
        iconName: "facebook-f",
        icon: [320, 512, [], "f39e", "M279.14 288l14.22-92.66h-88.91v-60.13c0-25.35 12.42-50.06 52.24-50.06h40.42V6.26S260.43 0 225.36 0c-73.22 0-121.08 44.38-121.08 124.72v70.62H22.89V288h81.39v224h100.17V288z"]
    }), ai.add({
        prefix: "fab",
        iconName: "twitter",
        icon: [512, 512, [], "f099", "M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"]
    }), ai.add({
        prefix: "fab",
        iconName: "linkedin-in",
        icon: [448, 512, [], "f0e1", "M100.28 448H7.4V148.9h92.88zM53.79 108.1C24.09 108.1 0 83.5 0 53.8a53.79 53.79 0 0 1 107.58 0c0 29.7-24.1 54.3-53.79 54.3zM447.9 448h-92.68V302.4c0-34.7-.7-79.2-48.29-79.2-48.29 0-55.69 37.7-55.69 76.7V448h-92.78V148.9h89.08v40.8h1.3c12.4-23.5 42.69-48.3 87.88-48.3 94 0 111.28 61.9 111.28 142.3V448z"]
    }), ai.add({
        prefix: "far",
        iconName: "envelope",
        icon: [512, 512, [], "f0e0", "M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm0 48v40.805c-22.422 18.259-58.168 46.651-134.587 106.49-16.841 13.247-50.201 45.072-73.413 44.701-23.208.375-56.579-31.459-73.413-44.701C106.18 199.465 70.425 171.067 48 152.805V112h416zM48 400V214.398c22.914 18.251 55.409 43.862 104.938 82.646 21.857 17.205 60.134 55.186 103.062 54.955 42.717.231 80.509-37.199 103.053-54.947 49.528-38.783 82.032-64.401 104.947-82.653V400H48z"]
    }), ai.add({
        prefix: "fas",
        iconName: "comment",
        icon: [512, 512, [], "f075", "M256 32C114.6 32 0 125.1 0 240c0 49.6 21.4 95 57 130.7C44.5 421.1 2.7 466 2.2 466.5c-2.2 2.3-2.8 5.7-1.5 8.7S4.8 480 8 480c66.3 0 116-31.8 140.6-51.4 32.7 12.3 69 19.4 107.4 19.4 141.4 0 256-93.1 256-208S397.4 32 256 32z"]
    }), ai.add({
        prefix: "fas",
        iconName: "question-circle",
        icon: [512, 512, [], "f059", "M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z"]
    });
    const li = ci({prefix: "fas", iconName: "spinner"}), di = ci({prefix: "fas", iconName: "upload"}),
        ui = (ci({prefix: "fas", iconName: "arrow-circle-left"}), ci({
            prefix: "fas",
            iconName: "arrow-circle-right"
        }), ci({prefix: "fas", iconName: "share"})), hi = ci({prefix: "far", iconName: "clipboard"}),
        pi = ci({prefix: "fas", iconName: "search-plus"}), mi = ci({prefix: "fas", iconName: "trash-alt"}),
        fi = ci({prefix: "fas", iconName: "exclamation-triangle"}), gi = ci({prefix: "fas", iconName: "info-circle"}),
        bi = ci({prefix: "fas", iconName: "check-circle"}), vi = ci({prefix: "far", iconName: "square"}),
        _i = ci({prefix: "far", iconName: "check-square"}),
        wi = (ci({prefix: "fas", iconName: "pencil-alt"}), ci({prefix: "fas", iconName: "grip-vertical"})),
        yi = ci({prefix: "fas", iconName: "times"}),
        xi = (ci({prefix: "fas", iconName: "play-circle"}), ci({prefix: "fas", iconName: "play"})),
        ki = ci({prefix: "fas", iconName: "pause"}),
        Si = (ci({prefix: "fas", iconName: "pause-circle"}), ci({prefix: "fas", iconName: "cog"})),
        Ci = ci({prefix: "fas", iconName: "plus-circle"}),
        Ei = (ci({prefix: "fas", iconName: "external-link-alt"}), ci({
            prefix: "fas",
            iconName: "list"
        }), ci({prefix: "fas", iconName: "chevron-right"}), ci({
            prefix: "fas",
            iconName: "chevron-left"
        }), ci({prefix: "fas", iconName: "tv"})), Ti = ci({prefix: "fas", iconName: "camera"}),
        Mi = ci({prefix: "fas", iconName: "ellipsis-v"}), Pi = ci({prefix: "fas", iconName: "code"}),
        Di = ci({prefix: "fab", iconName: "facebook-f"}), Ii = ci({prefix: "fab", iconName: "twitter"}),
        Ai = ci({prefix: "fab", iconName: "linkedin-in"}), Li = ci({prefix: "far", iconName: "envelope"}),
        Ni = ci({prefix: "fas", iconName: "comment"}), zi = ci({prefix: "fas", iconName: "question-circle"});
    var Ri = ee`:host{display:block;box-sizing:border-box}:host([hidden]),[hidden]{display:none!important}*{box-sizing:border-box}a{text-decoration:none;color:var(--brand-primary);cursor:pointer}a:hover{color:var(--brand-primary-shade)}h1,h2,h3{font-family:var(--font-family-heading);margin-top:0;font-weight:600}h1{font-size:var(--font-size-h1)}h2{font-size:var(--font-size-h2)}h3{font-size:var(--font-size-h3)}label{color:var(--text-color);font-size:var(--font-size-large)}.small{font-size:var(--font-size-small)}.muted{color:var(--text-muted)}ion-button+ion-button{margin-left:.25rem}.margin-bottom{margin-bottom:1rem}.alert{border:1px solid transparent;margin:1rem 0;border-radius:var(--border-radius);padding:1rem;color:var(--text-color)}.alert svg{height:1rem;width:1rem;vertical-align:middle;margin-left:-.5rem}.alert-info{border-color:var(--brand-info);color:var(--brand-info-color);background-color:var(--brand-info-bg)}`;
    const Oi = new e.Ray, $i = new e.Cartesian3;

    class Ui {
        constructor(t, i) {
            this._mapViewer = i, this._transformPanel = t, this._assetId = void 0, this._tilesetShow = void 0, this._tileset = void 0, this._transformEditor = void 0, this._transformEditorSubscription = [], this._unsavedChanges = !1, this._sseh = void 0, this._position = new e.Cartesian3, this._headingPitchRoll = new e.HeadingPitchRoll, this._scale = new e.Cartesian3, this._setViewModelPosition = this._setViewModelPosition.bind(this), this._setViewModelHpr = this._setViewModelHpr.bind(this), this._setViewModelScale = this._setViewModelScale.bind(this), this._setViewModelNonUniformScaling = this._setViewModelNonUniformScaling.bind(this), this._handlePicking = this._handlePicking.bind(this), this._save = this._save.bind(this)
        }

        get assetId() {
            return this._assetId
        }

        set assetId(t) {
            if (this._assetId === t) return;
            if (this._assetId = t, !e.defined(t)) return e.defined(this._tileset) && (this._tileset.show = this._tilesetShow), this._tileset = void 0, this._transformPanel.ready = !1, void this._deactivate();
            const i = this._mapViewer.getAssetInstance(t);
            this._tileset = i, this._tilesetShow = i.show, i.show = !0;
            const n = this._mapViewer.viewer;
            i.readyPromise.then(t => {
                let i;
                e.Matrix4.equals(t._root.transform, e.Matrix4.IDENTITY) ? i = t.modelMatrix : (i = e.Matrix4.clone(t._root.transform), t._root.transform = e.Matrix4.IDENTITY, t.modelMatrix = i);
                const o = new e.TransformEditor({
                    container: n.container,
                    scene: n.scene,
                    transform: t.modelMatrix,
                    boundingSphere: t.boundingSphere
                }), r = o.viewModel;
                this._transformEditor = o, this._position = e.Cartesian3.clone(r.position, this._position), this._headingPitchRoll = e.HeadingPitchRoll.clone(r.headingPitchRoll, this._headingPitchRoll), this._scale = e.Cartesian3.clone(r.scale, this._scale), this._initialize()
            })
        }

        _initialize() {
            const t = this._transformEditorSubscription, i = this._tileset, n = this._transformEditor.viewModel,
                o = this._transformPanel, r = this._position, a = this._headingPitchRoll, s = this._scale;
            n.activate(), o.initializeValues(this._mapViewer.viewer, i, r, a, s, n.enableNonUniformScaling), t.push(e.knockout.getObservable(n, "position").subscribe((function (t) {
                e.Cartesian3.equalsEpsilon(t, r, e.Math.EPSILON8) || (e.Cartesian3.clone(t, r), this._unsavedChanges = !0, o.position = t)
            }))), t.push(e.knockout.getObservable(n, "headingPitchRoll").subscribe((function (t) {
                e.HeadingPitchRoll.equals(t, a) || (e.HeadingPitchRoll.clone(t, a), this._unsavedChanges = !0, o.headingPitchRoll = t)
            }))), t.push(e.knockout.getObservable(n, "scale").subscribe((function (t) {
                e.Cartesian3.equals(t, s) || (e.Cartesian3.clone(t, s), this._unsavedChanges = !0, o.scale = t)
            }))), t.push(e.knockout.getObservable(n, "enableNonUniformScaling").subscribe((function (e) {
                o.enableNonUniformScaling = e
            }))), o.addEventhListener("positionChange", this._setViewModelPosition), o.addEventListener("headingPitchRollChange", this._setViewModelHpr), o.addEventListener("scaleChange", this._setViewModelScale), o.addEventListener("enableNonUniformScalingChange", this._setViewModelNonUniformScaling), o.addEventListener("pickingChange", this._handlePicking), o.addEventListener("save", this._save)
        }

        _handlePicking(t) {
            const i = this._mapViewer.viewer.scene;
            if (t.detail.picking) {
                if (e.defined(this._sseh)) return;
                const t = new e.ScreenSpaceEventHandler(i.canvas);
                this._sseh = t, t.setInputAction(t => {
                    const n = i.camera.getPickRay(t.position, Oi), o = i.globe.pick(n, i, $i);
                    e.defined(o) && (this._transformPanel.position = o, this._transformEditor.viewModel.position = o, this._unsavedChanges = !0, this._transformPanel.cancelPicking())
                }, e.ScreenSpaceEventType.LEFT_CLICK)
            } else e.defined(this._sseh) && (this._sseh.destroy(), this._sseh = void 0)
        }

        _setViewModelPosition(t) {
            const i = t.detail.position, n = this._position;
            e.Cartesian3.equalsEpsilon(i, n, e.Math.EPSILON8) || (e.Cartesian3.clone(i, n), this._unsavedChanges = !0, this._transformEditor.viewModel.position = i)
        }

        _setViewModelHpr(t) {
            const i = t.detail.headingPitchRoll, n = this._headingPitchRoll;
            e.HeadingPitchRoll.equals(i, n) || (e.HeadingPitchRoll.clone(i, n), this._unsavedChanges = !0, this._transformEditor.viewModel.headingPitchRoll = i)
        }

        _setViewModelScale(t) {
            const i = t.detail.scale, n = this._scale;
            e.Cartesian3.equals(i, n) || (e.Cartesian3.clone(i, n), this._unsavedChanges = !0, this._transformEditor.viewModel.scale = i)
        }

        _setViewModelNonUniformScaling(e) {
            this._transformEditor.viewModel.enableNonUniformScaling = e.detail.enableNonUniformScaling
        }

        _save() {
            dt.dispatch(Ue(this._assetId, this._tileset.modelMatrix))
        }

        _deactivate() {
            if (this._transformEditorSubscription.forEach((function (e) {
                e.dispose()
            })), e.defined(this._transformEditor) && this._transformEditor.destroy(), e.defined(this._transformPanel)) {
                const e = this._transformPanel;
                e.removeEventListener("positionChange", this._setViewModelPosition), e.removeEventListener("headingPitchRollChange", this._setViewModelHpr), e.removeEventListener("scaleChange", this._setViewModelScale), e.removeEventListener("enableNonUniformScalingChange", this._setViewModelNonUniformScaling), e.removeEventListener("pickingChange", this._handlePicking), e.removeEventListener("save", this._save)
            }
        }
    }

    const ji = new WeakMap, Fi = n(e => t => {
        if (!(t instanceof S)) throw new Error("unsafeHTML can only be used in text bindings");
        const i = ji.get(t);
        if (void 0 !== i && w(e) && e === i.value && t.value === i.fragment) return;
        const n = document.createElement("template");
        n.innerHTML = e;
        const o = document.importNode(n.content, !0);
        t.setValue(o), ji.set(t, {value: e, fragment: o})
    });
    var Vi = Object.freeze || function (e) {
            return e
        },
        Hi = Vi(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]),
        qi = Vi(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "audio", "canvas", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "video", "view", "vkern"]),
        Bi = Vi(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]),
        Wi = Vi(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover"]),
        Yi = Vi(["#text"]), Gi = Object.freeze || function (e) {
            return e
        },
        Ji = Gi(["accept", "action", "align", "alt", "autocomplete", "background", "bgcolor", "border", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "coords", "crossorigin", "datetime", "default", "dir", "disabled", "download", "enctype", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "integrity", "ismap", "label", "lang", "list", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "name", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "type", "usemap", "valign", "value", "width", "xmlns"]),
        Ki = Gi(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "tabindex", "targetx", "targety", "transform", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]),
        Zi = Gi(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]),
        Xi = Gi(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Qi = Object.hasOwnProperty,
        en = Object.setPrototypeOf, tn = ("undefined" != typeof Reflect && Reflect).apply;

    function nn(e, t) {
        en && en(e, null);
        for (var i = t.length; i--;) {
            var n = t[i];
            if ("string" == typeof n) {
                var o = n.toLowerCase();
                o !== n && (Object.isFrozen(t) || (t[i] = o), n = o)
            }
            e[n] = !0
        }
        return e
    }

    function on(e) {
        var t = {}, i = void 0;
        for (i in e) tn(Qi, e, [i]) && (t[i] = e[i]);
        return t
    }

    tn || (tn = function (e, t, i) {
        return e.apply(t, i)
    });
    var rn = Object.seal || function (e) {
            return e
        }, an = rn(/\{\{[\s\S]*|[\s\S]*\}\}/gm), sn = rn(/<%[\s\S]*|[\s\S]*%>/gm), cn = rn(/^data-[\-\w.\u00B7-\uFFFF]/),
        ln = rn(/^aria-[\-\w]+$/),
        dn = rn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),
        un = rn(/^(?:\w+script|data):/i), hn = rn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g),
        pn = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
            return typeof e
        } : function (e) {
            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
        };

    function mn(e) {
        if (Array.isArray(e)) {
            for (var t = 0, i = Array(e.length); t < e.length; t++) i[t] = e[t];
            return i
        }
        return Array.from(e)
    }

    var fn = ("undefined" != typeof Reflect && Reflect).apply, gn = Array.prototype.slice, bn = Object.freeze,
        vn = function () {
            return "undefined" == typeof window ? null : window
        };
    fn || (fn = function (e, t, i) {
        return e.apply(t, i)
    });
    var _n = function (e, t) {
        if ("object" !== (void 0 === e ? "undefined" : pn(e)) || "function" != typeof e.createPolicy) return null;
        var i = null;
        t.currentScript && t.currentScript.hasAttribute("data-tt-policy-suffix") && (i = t.currentScript.getAttribute("data-tt-policy-suffix"));
        var n = "dompurify" + (i ? "#" + i : "");
        try {
            return e.createPolicy(n, {
                createHTML: function (e) {
                    return e
                }
            })
        } catch (e) {
            return console.warn("TrustedTypes policy " + n + " could not be created."), null
        }
    };
    var wn = function e() {
            var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : vn(), i = function (t) {
                return e(t)
            };
            if (i.version = "2.0.7", i.removed = [], !t || !t.document || 9 !== t.document.nodeType) return i.isSupported = !1, i;
            var n = t.document, o = !1, r = !1, a = t.document, s = t.DocumentFragment, c = t.HTMLTemplateElement,
                l = t.Node, d = t.NodeFilter, u = t.NamedNodeMap,
                h = void 0 === u ? t.NamedNodeMap || t.MozNamedAttrMap : u, p = t.Text, m = t.Comment, f = t.DOMParser,
                g = t.TrustedTypes;
            if ("function" == typeof c) {
                var b = a.createElement("template");
                b.content && b.content.ownerDocument && (a = b.content.ownerDocument)
            }
            var v = _n(g, n), _ = v ? v.createHTML("") : "", w = a, y = w.implementation, x = w.createNodeIterator,
                k = w.getElementsByTagName, S = w.createDocumentFragment, C = n.importNode, E = {};
            i.isSupported = y && void 0 !== y.createHTMLDocument && 9 !== a.documentMode;
            var T = an, M = sn, P = cn, D = ln, I = un, A = hn, L = dn, N = null,
                z = nn({}, [].concat(mn(Hi), mn(qi), mn(Bi), mn(Wi), mn(Yi))), R = null,
                O = nn({}, [].concat(mn(Ji), mn(Ki), mn(Zi), mn(Xi))), $ = null, U = null, j = !0, F = !0, V = !1, H = !1,
                q = !1, B = !1, W = !1, Y = !1, G = !1, J = !1, K = !1, Z = !1, X = !0, Q = !0, ee = !1, te = {},
                ie = nn({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]),
                ne = nn({}, ["audio", "video", "img", "source", "image"]), oe = null,
                re = nn({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "summary", "title", "value", "style", "xmlns"]),
                ae = null, se = a.createElement("form"), ce = function (e) {
                    ae && ae === e || (e && "object" === (void 0 === e ? "undefined" : pn(e)) || (e = {}), N = "ALLOWED_TAGS" in e ? nn({}, e.ALLOWED_TAGS) : z, R = "ALLOWED_ATTR" in e ? nn({}, e.ALLOWED_ATTR) : O, oe = "ADD_URI_SAFE_ATTR" in e ? nn(on(re), e.ADD_URI_SAFE_ATTR) : re, $ = "FORBID_TAGS" in e ? nn({}, e.FORBID_TAGS) : {}, U = "FORBID_ATTR" in e ? nn({}, e.FORBID_ATTR) : {}, te = "USE_PROFILES" in e && e.USE_PROFILES, j = !1 !== e.ALLOW_ARIA_ATTR, F = !1 !== e.ALLOW_DATA_ATTR, V = e.ALLOW_UNKNOWN_PROTOCOLS || !1, H = e.SAFE_FOR_JQUERY || !1, q = e.SAFE_FOR_TEMPLATES || !1, B = e.WHOLE_DOCUMENT || !1, G = e.RETURN_DOM || !1, J = e.RETURN_DOM_FRAGMENT || !1, K = e.RETURN_DOM_IMPORT || !1, Z = e.RETURN_TRUSTED_TYPE || !1, Y = e.FORCE_BODY || !1, X = !1 !== e.SANITIZE_DOM, Q = !1 !== e.KEEP_CONTENT, ee = e.IN_PLACE || !1, L = e.ALLOWED_URI_REGEXP || L, q && (F = !1), J && (G = !0), te && (N = nn({}, [].concat(mn(Yi))), R = [], !0 === te.html && (nn(N, Hi), nn(R, Ji)), !0 === te.svg && (nn(N, qi), nn(R, Ki), nn(R, Xi)), !0 === te.svgFilters && (nn(N, Bi), nn(R, Ki), nn(R, Xi)), !0 === te.mathMl && (nn(N, Wi), nn(R, Zi), nn(R, Xi))), e.ADD_TAGS && (N === z && (N = on(N)), nn(N, e.ADD_TAGS)), e.ADD_ATTR && (R === O && (R = on(R)), nn(R, e.ADD_ATTR)), e.ADD_URI_SAFE_ATTR && nn(oe, e.ADD_URI_SAFE_ATTR), Q && (N["#text"] = !0), B && nn(N, ["html", "head", "body"]), N.table && (nn(N, ["tbody"]), delete $.tbody), bn && bn(e), ae = e)
                }, le = function (e) {
                    i.removed.push({element: e});
                    try {
                        e.parentNode.removeChild(e)
                    } catch (t) {
                        e.outerHTML = _
                    }
                }, de = function (e, t) {
                    try {
                        i.removed.push({attribute: t.getAttributeNode(e), from: t})
                    } catch (e) {
                        i.removed.push({attribute: null, from: t})
                    }
                    t.removeAttribute(e)
                }, ue = function (e) {
                    var t = void 0, i = void 0;
                    if (Y) e = "<remove></remove>" + e; else {
                        var n = e.match(/^[\s]+/);
                        (i = n && n[0]) && (e = e.slice(i.length))
                    }
                    if (o) try {
                        t = (new f).parseFromString(e, "text/html")
                    } catch (e) {
                    }
                    if (r && nn($, ["title"]), !t || !t.documentElement) {
                        var s = (t = y.createHTMLDocument("")).body;
                        s.parentNode.removeChild(s.parentNode.firstElementChild), s.outerHTML = v ? v.createHTML(e) : e
                    }
                    return e && i && t.body.insertBefore(a.createTextNode(i), t.body.childNodes[0] || null), k.call(t, B ? "html" : "body")[0]
                };
            i.isSupported && (function () {
                try {
                    ue('<svg><p><textarea><img src="</textarea><img src=x abc=1//">').querySelector("svg img") && (o = !0)
                } catch (e) {
                }
            }(), function () {
                try {
                    var e = ue("<x/><title>&lt;/title&gt;&lt;img&gt;");
                    /<\/title/.test(e.querySelector("title").innerHTML) && (r = !0)
                } catch (e) {
                }
            }());
            var he = function (e) {
                return x.call(e.ownerDocument || e, e, d.SHOW_ELEMENT | d.SHOW_COMMENT | d.SHOW_TEXT, (function () {
                    return d.FILTER_ACCEPT
                }), !1)
            }, pe = function (e) {
                return !(e instanceof p || e instanceof m) && !("string" == typeof e.nodeName && "string" == typeof e.textContent && "function" == typeof e.removeChild && e.attributes instanceof h && "function" == typeof e.removeAttribute && "function" == typeof e.setAttribute && "string" == typeof e.namespaceURI)
            }, me = function (e) {
                return "object" === (void 0 === l ? "undefined" : pn(l)) ? e instanceof l : e && "object" === (void 0 === e ? "undefined" : pn(e)) && "number" == typeof e.nodeType && "string" == typeof e.nodeName
            }, fe = function (e, t, n) {
                E[e] && E[e].forEach((function (e) {
                    e.call(i, t, n, ae)
                }))
            }, ge = function (e) {
                var t = void 0;
                if (fe("beforeSanitizeElements", e, null), pe(e)) return le(e), !0;
                var n = e.nodeName.toLowerCase();
                if (fe("uponSanitizeElement", e, {
                    tagName: n,
                    allowedTags: N
                }), ("svg" === n || "math" === n) && 0 !== e.querySelectorAll("p, br").length) return le(e), !0;
                if (!N[n] || $[n]) {
                    if (Q && !ie[n] && "function" == typeof e.insertAdjacentHTML) try {
                        var o = e.innerHTML;
                        e.insertAdjacentHTML("AfterEnd", v ? v.createHTML(o) : o)
                    } catch (e) {
                    }
                    return le(e), !0
                }
                return "noscript" === n && /<\/noscript/i.test(e.innerHTML) ? (le(e), !0) : "noembed" === n && /<\/noembed/i.test(e.innerHTML) ? (le(e), !0) : (!H || e.firstElementChild || e.content && e.content.firstElementChild || !/</g.test(e.textContent) || (i.removed.push({element: e.cloneNode()}), e.innerHTML ? e.innerHTML = e.innerHTML.replace(/</g, "&lt;") : e.innerHTML = e.textContent.replace(/</g, "&lt;")), q && 3 === e.nodeType && (t = (t = (t = e.textContent).replace(T, " ")).replace(M, " "), e.textContent !== t && (i.removed.push({element: e.cloneNode()}), e.textContent = t)), fe("afterSanitizeElements", e, null), !1)
            }, be = function (e, t, i) {
                if (X && ("id" === t || "name" === t) && (i in a || i in se)) return !1;
                if (F && P.test(t)) ; else if (j && D.test(t)) ; else {
                    if (!R[t] || U[t]) return !1;
                    if (oe[t]) ; else if (L.test(i.replace(A, ""))) ; else if ("src" !== t && "xlink:href" !== t && "href" !== t || "script" === e || 0 !== i.indexOf("data:") || !ne[e]) {
                        if (V && !I.test(i.replace(A, ""))) ; else if (i) return !1
                    } else ;
                }
                return !0
            }, ve = function (e) {
                var t = void 0, n = void 0, o = void 0, r = void 0, a = void 0;
                fe("beforeSanitizeAttributes", e, null);
                var s = e.attributes;
                if (s) {
                    var c = {attrName: "", attrValue: "", keepAttr: !0, allowedAttributes: R};
                    for (a = s.length; a--;) {
                        var l = t = s[a], d = l.name, u = l.namespaceURI;
                        if (n = t.value.trim(), o = d.toLowerCase(), c.attrName = o, c.attrValue = n, c.keepAttr = !0, fe("uponSanitizeAttribute", e, c), n = c.attrValue, "name" === o && "IMG" === e.nodeName && s.id) r = s.id, s = fn(gn, s, []), de("id", e), de(d, e), s.indexOf(r) > a && e.setAttribute("id", r.value); else {
                            if ("INPUT" === e.nodeName && "type" === o && "file" === n && c.keepAttr && (R[o] || !U[o])) continue;
                            "id" === d && e.setAttribute(d, ""), de(d, e)
                        }
                        if (c.keepAttr) if (/svg|math/i.test(e.namespaceURI) && new RegExp("</(" + Object.keys(ie).join("|") + ")", "i").test(n)) de(d, e); else {
                            q && (n = (n = n.replace(T, " ")).replace(M, " "));
                            var h = e.nodeName.toLowerCase();
                            if (be(h, o, n)) try {
                                u ? e.setAttributeNS(u, d, n) : e.setAttribute(d, n), i.removed.pop()
                            } catch (e) {
                            }
                        }
                    }
                    fe("afterSanitizeAttributes", e, null)
                }
            }, _e = function e(t) {
                var i = void 0, n = he(t);
                for (fe("beforeSanitizeShadowDOM", t, null); i = n.nextNode();) fe("uponSanitizeShadowNode", i, null), ge(i) || (i.content instanceof s && e(i.content), ve(i));
                fe("afterSanitizeShadowDOM", t, null)
            };
            return i.sanitize = function (e, o) {
                var r = void 0, a = void 0, c = void 0, d = void 0, u = void 0;
                if (e || (e = "\x3c!--\x3e"), "string" != typeof e && !me(e)) {
                    if ("function" != typeof e.toString) throw new TypeError("toString is not a function");
                    if ("string" != typeof (e = e.toString())) throw new TypeError("dirty is not a string, aborting")
                }
                if (!i.isSupported) {
                    if ("object" === pn(t.toStaticHTML) || "function" == typeof t.toStaticHTML) {
                        if ("string" == typeof e) return t.toStaticHTML(e);
                        if (me(e)) return t.toStaticHTML(e.outerHTML)
                    }
                    return e
                }
                if (W || ce(o), i.removed = [], ee) ; else if (e instanceof l) 1 === (a = (r = ue("\x3c!--\x3e")).ownerDocument.importNode(e, !0)).nodeType && "BODY" === a.nodeName ? r = a : "HTML" === a.nodeName ? r = a : r.appendChild(a); else {
                    if (!G && !q && !B && Z && -1 === e.indexOf("<")) return v ? v.createHTML(e) : e;
                    if (!(r = ue(e))) return G ? null : _
                }
                r && Y && le(r.firstChild);
                for (var h = he(ee ? e : r); c = h.nextNode();) 3 === c.nodeType && c === d || ge(c) || (c.content instanceof s && _e(c.content), ve(c), d = c);
                if (d = null, ee) return e;
                if (G) {
                    if (J) for (u = S.call(r.ownerDocument); r.firstChild;) u.appendChild(r.firstChild); else u = r;
                    return K && (u = C.call(n, u, !0)), u
                }
                var p = B ? r.outerHTML : r.innerHTML;
                return q && (p = (p = p.replace(T, " ")).replace(M, " ")), v && Z ? v.createHTML(p) : p
            }, i.setConfig = function (e) {
                ce(e), W = !0
            }, i.clearConfig = function () {
                ae = null, W = !1
            }, i.isValidAttribute = function (e, t, i) {
                ae || ce({});
                var n = e.toLowerCase(), o = t.toLowerCase();
                return be(n, o, i)
            }, i.addHook = function (e, t) {
                "function" == typeof t && (E[e] = E[e] || [], E[e].push(t))
            }, i.removeHook = function (e) {
                E[e] && E[e].pop()
            }, i.removeHooks = function (e) {
                E[e] && (E[e] = [])
            }, i.removeAllHooks = function () {
                E = {}
            }, i
        }(),
        yn = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};

    function xn(e, t) {
        return e(t = {exports: {}}, t.exports), t.exports
    }

    var kn = xn((function (e) {
        (function () {
            function t(e) {
                var t = {
                    omitExtraWLInCodeBlocks: {
                        defaultValue: !1,
                        describe: "Omit the default extra whiteline added to code blocks",
                        type: "boolean"
                    },
                    noHeaderId: {defaultValue: !1, describe: "Turn on/off generated header id", type: "boolean"},
                    prefixHeaderId: {
                        defaultValue: !1,
                        describe: "Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",
                        type: "string"
                    },
                    rawPrefixHeaderId: {
                        defaultValue: !1,
                        describe: 'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',
                        type: "boolean"
                    },
                    ghCompatibleHeaderId: {
                        defaultValue: !1,
                        describe: "Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",
                        type: "boolean"
                    },
                    rawHeaderId: {
                        defaultValue: !1,
                        describe: "Remove only spaces, ' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids",
                        type: "boolean"
                    },
                    headerLevelStart: {defaultValue: !1, describe: "The header blocks level start", type: "integer"},
                    parseImgDimensions: {
                        defaultValue: !1,
                        describe: "Turn on/off image dimension parsing",
                        type: "boolean"
                    },
                    simplifiedAutoLink: {defaultValue: !1, describe: "Turn on/off GFM autolink style", type: "boolean"},
                    excludeTrailingPunctuationFromURLs: {
                        defaultValue: !1,
                        describe: "Excludes trailing punctuation from links generated with autoLinking",
                        type: "boolean"
                    },
                    literalMidWordUnderscores: {
                        defaultValue: !1,
                        describe: "Parse midword underscores as literal underscores",
                        type: "boolean"
                    },
                    literalMidWordAsterisks: {
                        defaultValue: !1,
                        describe: "Parse midword asterisks as literal asterisks",
                        type: "boolean"
                    },
                    strikethrough: {defaultValue: !1, describe: "Turn on/off strikethrough support", type: "boolean"},
                    tables: {defaultValue: !1, describe: "Turn on/off tables support", type: "boolean"},
                    tablesHeaderId: {defaultValue: !1, describe: "Add an id to table headers", type: "boolean"},
                    ghCodeBlocks: {
                        defaultValue: !0,
                        describe: "Turn on/off GFM fenced code blocks support",
                        type: "boolean"
                    },
                    tasklists: {defaultValue: !1, describe: "Turn on/off GFM tasklist support", type: "boolean"},
                    smoothLivePreview: {
                        defaultValue: !1,
                        describe: "Prevents weird effects in live previews due to incomplete input",
                        type: "boolean"
                    },
                    smartIndentationFix: {
                        defaultValue: !1,
                        description: "Tries to smartly fix indentation in es6 strings",
                        type: "boolean"
                    },
                    disableForced4SpacesIndentedSublists: {
                        defaultValue: !1,
                        description: "Disables the requirement of indenting nested sublists by 4 spaces",
                        type: "boolean"
                    },
                    simpleLineBreaks: {
                        defaultValue: !1,
                        description: "Parses simple line breaks as <br> (GFM Style)",
                        type: "boolean"
                    },
                    requireSpaceBeforeHeadingText: {
                        defaultValue: !1,
                        description: "Makes adding a space between `#` and the header text mandatory (GFM Style)",
                        type: "boolean"
                    },
                    ghMentions: {defaultValue: !1, description: "Enables github @mentions", type: "boolean"},
                    ghMentionsLink: {
                        defaultValue: "https://github.com/{u}",
                        description: "Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",
                        type: "string"
                    },
                    encodeEmails: {
                        defaultValue: !0,
                        description: "Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",
                        type: "boolean"
                    },
                    openLinksInNewWindow: {
                        defaultValue: !1,
                        description: "Open all links in new windows",
                        type: "boolean"
                    },
                    backslashEscapesHTMLTags: {
                        defaultValue: !1,
                        description: "Support for HTML Tag escaping. ex: <div>foo</div>",
                        type: "boolean"
                    },
                    emoji: {
                        defaultValue: !1,
                        description: "Enable emoji support. Ex: `this is a :smile: emoji`",
                        type: "boolean"
                    },
                    underline: {
                        defaultValue: !1,
                        description: "Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",
                        type: "boolean"
                    },
                    completeHTMLDocument: {
                        defaultValue: !1,
                        description: "Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",
                        type: "boolean"
                    },
                    metadata: {
                        defaultValue: !1,
                        description: "Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",
                        type: "boolean"
                    },
                    splitAdjacentBlockquotes: {
                        defaultValue: !1,
                        description: "Split adjacent blockquote blocks",
                        type: "boolean"
                    }
                };
                if (!1 === e) return JSON.parse(JSON.stringify(t));
                var i = {};
                for (var n in t) t.hasOwnProperty(n) && (i[n] = t[n].defaultValue);
                return i
            }

            var i = {}, n = {}, o = {}, r = t(!0), a = "vanilla", s = {
                github: {
                    omitExtraWLInCodeBlocks: !0,
                    simplifiedAutoLink: !0,
                    excludeTrailingPunctuationFromURLs: !0,
                    literalMidWordUnderscores: !0,
                    strikethrough: !0,
                    tables: !0,
                    tablesHeaderId: !0,
                    ghCodeBlocks: !0,
                    tasklists: !0,
                    disableForced4SpacesIndentedSublists: !0,
                    simpleLineBreaks: !0,
                    requireSpaceBeforeHeadingText: !0,
                    ghCompatibleHeaderId: !0,
                    ghMentions: !0,
                    backslashEscapesHTMLTags: !0,
                    emoji: !0,
                    splitAdjacentBlockquotes: !0
                },
                original: {noHeaderId: !0, ghCodeBlocks: !1},
                ghost: {
                    omitExtraWLInCodeBlocks: !0,
                    parseImgDimensions: !0,
                    simplifiedAutoLink: !0,
                    excludeTrailingPunctuationFromURLs: !0,
                    literalMidWordUnderscores: !0,
                    strikethrough: !0,
                    tables: !0,
                    tablesHeaderId: !0,
                    ghCodeBlocks: !0,
                    tasklists: !0,
                    smoothLivePreview: !0,
                    simpleLineBreaks: !0,
                    requireSpaceBeforeHeadingText: !0,
                    ghMentions: !1,
                    encodeEmails: !0
                },
                vanilla: t(!0),
                allOn: function () {
                    var e = t(!0), i = {};
                    for (var n in e) e.hasOwnProperty(n) && (i[n] = !0);
                    return i
                }()
            };

            function c(e, t) {
                var n = t ? "Error in " + t + " extension->" : "Error in unnamed extension", o = {valid: !0, error: ""};
                i.helper.isArray(e) || (e = [e]);
                for (var r = 0; r < e.length; ++r) {
                    var a = n + " sub-extension " + r + ": ", s = e[r];
                    if ("object" != typeof s) return o.valid = !1, o.error = a + "must be an object, but " + typeof s + " given", o;
                    if (!i.helper.isString(s.type)) return o.valid = !1, o.error = a + 'property "type" must be a string, but ' + typeof s.type + " given", o;
                    var c = s.type = s.type.toLowerCase();
                    if ("language" === c && (c = s.type = "lang"), "html" === c && (c = s.type = "output"), "lang" !== c && "output" !== c && "listener" !== c) return o.valid = !1, o.error = a + "type " + c + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"', o;
                    if ("listener" === c) {
                        if (i.helper.isUndefined(s.listeners)) return o.valid = !1, o.error = a + '. Extensions of type "listener" must have a property called "listeners"', o
                    } else if (i.helper.isUndefined(s.filter) && i.helper.isUndefined(s.regex)) return o.valid = !1, o.error = a + c + ' extensions must define either a "regex" property or a "filter" method', o;
                    if (s.listeners) {
                        if ("object" != typeof s.listeners) return o.valid = !1, o.error = a + '"listeners" property must be an object but ' + typeof s.listeners + " given", o;
                        for (var l in s.listeners) if (s.listeners.hasOwnProperty(l) && "function" != typeof s.listeners[l]) return o.valid = !1, o.error = a + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + l + " must be a function but " + typeof s.listeners[l] + " given", o
                    }
                    if (s.filter) {
                        if ("function" != typeof s.filter) return o.valid = !1, o.error = a + '"filter" must be a function, but ' + typeof s.filter + " given", o
                    } else if (s.regex) {
                        if (i.helper.isString(s.regex) && (s.regex = new RegExp(s.regex, "g")), !(s.regex instanceof RegExp)) return o.valid = !1, o.error = a + '"regex" property must either be a string or a RegExp object, but ' + typeof s.regex + " given", o;
                        if (i.helper.isUndefined(s.replace)) return o.valid = !1, o.error = a + '"regex" extensions must implement a replace string or function', o
                    }
                }
                return o
            }

            function l(e, t) {
                return "¨E" + t.charCodeAt(0) + "E"
            }

            i.helper = {}, i.extensions = {}, i.setOption = function (e, t) {
                return r[e] = t, this
            }, i.getOption = function (e) {
                return r[e]
            }, i.getOptions = function () {
                return r
            }, i.resetOptions = function () {
                r = t(!0)
            }, i.setFlavor = function (e) {
                if (!s.hasOwnProperty(e)) throw Error(e + " flavor was not found");
                i.resetOptions();
                var t = s[e];
                for (var n in a = e, t) t.hasOwnProperty(n) && (r[n] = t[n])
            }, i.getFlavor = function () {
                return a
            }, i.getFlavorOptions = function (e) {
                if (s.hasOwnProperty(e)) return s[e]
            }, i.getDefaultOptions = function (e) {
                return t(e)
            }, i.subParser = function (e, t) {
                if (i.helper.isString(e)) {
                    if (void 0 === t) {
                        if (n.hasOwnProperty(e)) return n[e];
                        throw Error("SubParser named " + e + " not registered!")
                    }
                    n[e] = t
                }
            }, i.extension = function (e, t) {
                if (!i.helper.isString(e)) throw Error("Extension 'name' must be a string");
                if (e = i.helper.stdExtName(e), i.helper.isUndefined(t)) {
                    if (!o.hasOwnProperty(e)) throw Error("Extension named " + e + " is not registered!");
                    return o[e]
                }
                "function" == typeof t && (t = t()), i.helper.isArray(t) || (t = [t]);
                var n = c(t, e);
                if (!n.valid) throw Error(n.error);
                o[e] = t
            }, i.getAllExtensions = function () {
                return o
            }, i.removeExtension = function (e) {
                delete o[e]
            }, i.resetExtensions = function () {
                o = {}
            }, i.validateExtension = function (e) {
                var t = c(e, null);
                return !!t.valid || (console.warn(t.error), !1)
            }, i.hasOwnProperty("helper") || (i.helper = {}), i.helper.isString = function (e) {
                return "string" == typeof e || e instanceof String
            }, i.helper.isFunction = function (e) {
                return e && "[object Function]" === {}.toString.call(e)
            }, i.helper.isArray = function (e) {
                return Array.isArray(e)
            }, i.helper.isUndefined = function (e) {
                return void 0 === e
            }, i.helper.forEach = function (e, t) {
                if (i.helper.isUndefined(e)) throw new Error("obj param is required");
                if (i.helper.isUndefined(t)) throw new Error("callback param is required");
                if (!i.helper.isFunction(t)) throw new Error("callback param must be a function/closure");
                if ("function" == typeof e.forEach) e.forEach(t); else if (i.helper.isArray(e)) for (var n = 0; n < e.length; n++) t(e[n], n, e); else {
                    if ("object" != typeof e) throw new Error("obj does not seem to be an array or an iterable object");
                    for (var o in e) e.hasOwnProperty(o) && t(e[o], o, e)
                }
            }, i.helper.stdExtName = function (e) {
                return e.replace(/[_?*+\/\\.^-]/g, "").replace(/\s/g, "").toLowerCase()
            }, i.helper.escapeCharactersCallback = l, i.helper.escapeCharacters = function (e, t, i) {
                var n = "([" + t.replace(/([\[\]\\])/g, "\\$1") + "])";
                i && (n = "\\\\" + n);
                var o = new RegExp(n, "g");
                return e = e.replace(o, l)
            }, i.helper.unescapeHTMLEntities = function (e) {
                return e.replace(/&quot;/g, '"').replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&")
            };
            var d = function (e, t, i, n) {
                var o, r, a, s, c, l = n || "", d = l.indexOf("g") > -1,
                    u = new RegExp(t + "|" + i, "g" + l.replace(/g/g, "")), h = new RegExp(t, l.replace(/g/g, "")),
                    p = [];
                do {
                    for (o = 0; a = u.exec(e);) if (h.test(a[0])) o++ || (s = (r = u.lastIndex) - a[0].length); else if (o && !--o) {
                        c = a.index + a[0].length;
                        var m = {
                            left: {start: s, end: r},
                            match: {start: r, end: a.index},
                            right: {start: a.index, end: c},
                            wholeMatch: {start: s, end: c}
                        };
                        if (p.push(m), !d) return p
                    }
                } while (o && (u.lastIndex = r));
                return p
            };
            i.helper.matchRecursiveRegExp = function (e, t, i, n) {
                for (var o = d(e, t, i, n), r = [], a = 0; a < o.length; ++a) r.push([e.slice(o[a].wholeMatch.start, o[a].wholeMatch.end), e.slice(o[a].match.start, o[a].match.end), e.slice(o[a].left.start, o[a].left.end), e.slice(o[a].right.start, o[a].right.end)]);
                return r
            }, i.helper.replaceRecursiveRegExp = function (e, t, n, o, r) {
                if (!i.helper.isFunction(t)) {
                    var a = t;
                    t = function () {
                        return a
                    }
                }
                var s = d(e, n, o, r), c = e, l = s.length;
                if (l > 0) {
                    var u = [];
                    0 !== s[0].wholeMatch.start && u.push(e.slice(0, s[0].wholeMatch.start));
                    for (var h = 0; h < l; ++h) u.push(t(e.slice(s[h].wholeMatch.start, s[h].wholeMatch.end), e.slice(s[h].match.start, s[h].match.end), e.slice(s[h].left.start, s[h].left.end), e.slice(s[h].right.start, s[h].right.end))), h < l - 1 && u.push(e.slice(s[h].wholeMatch.end, s[h + 1].wholeMatch.start));
                    s[l - 1].wholeMatch.end < e.length && u.push(e.slice(s[l - 1].wholeMatch.end)), c = u.join("")
                }
                return c
            }, i.helper.regexIndexOf = function (e, t, n) {
                if (!i.helper.isString(e)) throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";
                if (t instanceof RegExp == !1) throw"InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";
                var o = e.substring(n || 0).search(t);
                return o >= 0 ? o + (n || 0) : o
            }, i.helper.splitAtIndex = function (e, t) {
                if (!i.helper.isString(e)) throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";
                return [e.substring(0, t), e.substring(t)]
            }, i.helper.encodeEmailAddress = function (e) {
                var t = [function (e) {
                    return "&#" + e.charCodeAt(0) + ";"
                }, function (e) {
                    return "&#x" + e.charCodeAt(0).toString(16) + ";"
                }, function (e) {
                    return e
                }];
                return e = e.replace(/./g, (function (e) {
                    if ("@" === e) e = t[Math.floor(2 * Math.random())](e); else {
                        var i = Math.random();
                        e = i > .9 ? t[2](e) : i > .45 ? t[1](e) : t[0](e)
                    }
                    return e
                }))
            }, i.helper.padEnd = function (e, t, i) {
                return t >>= 0, i = String(i || " "), e.length > t ? String(e) : ((t -= e.length) > i.length && (i += i.repeat(t / i.length)), String(e) + i.slice(0, t))
            }, "undefined" == typeof console && (console = {
                warn: function (e) {
                    alert(e)
                }, log: function (e) {
                    alert(e)
                }, error: function (e) {
                    throw e
                }
            }), i.helper.regexes = {asteriskDashAndColon: /([*_:~])/g}, i.helper.emojis = {
                "+1": "👍",
                "-1": "👎",
                100: "💯",
                1234: "🔢",
                "1st_place_medal": "🥇",
                "2nd_place_medal": "🥈",
                "3rd_place_medal": "🥉",
                "8ball": "🎱",
                a: "🅰️",
                ab: "🆎",
                abc: "🔤",
                abcd: "🔡",
                accept: "🉑",
                aerial_tramway: "🚡",
                airplane: "✈️",
                alarm_clock: "⏰",
                alembic: "⚗️",
                alien: "👽",
                ambulance: "🚑",
                amphora: "🏺",
                anchor: "⚓️",
                angel: "👼",
                anger: "💢",
                angry: "😠",
                anguished: "😧",
                ant: "🐜",
                apple: "🍎",
                aquarius: "♒️",
                aries: "♈️",
                arrow_backward: "◀️",
                arrow_double_down: "⏬",
                arrow_double_up: "⏫",
                arrow_down: "⬇️",
                arrow_down_small: "🔽",
                arrow_forward: "▶️",
                arrow_heading_down: "⤵️",
                arrow_heading_up: "⤴️",
                arrow_left: "⬅️",
                arrow_lower_left: "↙️",
                arrow_lower_right: "↘️",
                arrow_right: "➡️",
                arrow_right_hook: "↪️",
                arrow_up: "⬆️",
                arrow_up_down: "↕️",
                arrow_up_small: "🔼",
                arrow_upper_left: "↖️",
                arrow_upper_right: "↗️",
                arrows_clockwise: "🔃",
                arrows_counterclockwise: "🔄",
                art: "🎨",
                articulated_lorry: "🚛",
                artificial_satellite: "🛰",
                astonished: "😲",
                athletic_shoe: "👟",
                atm: "🏧",
                atom_symbol: "⚛️",
                avocado: "🥑",
                b: "🅱️",
                baby: "👶",
                baby_bottle: "🍼",
                baby_chick: "🐤",
                baby_symbol: "🚼",
                back: "🔙",
                bacon: "🥓",
                badminton: "🏸",
                baggage_claim: "🛄",
                baguette_bread: "🥖",
                balance_scale: "⚖️",
                balloon: "🎈",
                ballot_box: "🗳",
                ballot_box_with_check: "☑️",
                bamboo: "🎍",
                banana: "🍌",
                bangbang: "‼️",
                bank: "🏦",
                bar_chart: "📊",
                barber: "💈",
                baseball: "⚾️",
                basketball: "🏀",
                basketball_man: "⛹️",
                basketball_woman: "⛹️&zwj;♀️",
                bat: "🦇",
                bath: "🛀",
                bathtub: "🛁",
                battery: "🔋",
                beach_umbrella: "🏖",
                bear: "🐻",
                bed: "🛏",
                bee: "🐝",
                beer: "🍺",
                beers: "🍻",
                beetle: "🐞",
                beginner: "🔰",
                bell: "🔔",
                bellhop_bell: "🛎",
                bento: "🍱",
                biking_man: "🚴",
                bike: "🚲",
                biking_woman: "🚴&zwj;♀️",
                bikini: "👙",
                biohazard: "☣️",
                bird: "🐦",
                birthday: "🎂",
                black_circle: "⚫️",
                black_flag: "🏴",
                black_heart: "🖤",
                black_joker: "🃏",
                black_large_square: "⬛️",
                black_medium_small_square: "◾️",
                black_medium_square: "◼️",
                black_nib: "✒️",
                black_small_square: "▪️",
                black_square_button: "🔲",
                blonde_man: "👱",
                blonde_woman: "👱&zwj;♀️",
                blossom: "🌼",
                blowfish: "🐡",
                blue_book: "📘",
                blue_car: "🚙",
                blue_heart: "💙",
                blush: "😊",
                boar: "🐗",
                boat: "⛵️",
                bomb: "💣",
                book: "📖",
                bookmark: "🔖",
                bookmark_tabs: "📑",
                books: "📚",
                boom: "💥",
                boot: "👢",
                bouquet: "💐",
                bowing_man: "🙇",
                bow_and_arrow: "🏹",
                bowing_woman: "🙇&zwj;♀️",
                bowling: "🎳",
                boxing_glove: "🥊",
                boy: "👦",
                bread: "🍞",
                bride_with_veil: "👰",
                bridge_at_night: "🌉",
                briefcase: "💼",
                broken_heart: "💔",
                bug: "🐛",
                building_construction: "🏗",
                bulb: "💡",
                bullettrain_front: "🚅",
                bullettrain_side: "🚄",
                burrito: "🌯",
                bus: "🚌",
                business_suit_levitating: "🕴",
                busstop: "🚏",
                bust_in_silhouette: "👤",
                busts_in_silhouette: "👥",
                butterfly: "🦋",
                cactus: "🌵",
                cake: "🍰",
                calendar: "📆",
                call_me_hand: "🤙",
                calling: "📲",
                camel: "🐫",
                camera: "📷",
                camera_flash: "📸",
                camping: "🏕",
                cancer: "♋️",
                candle: "🕯",
                candy: "🍬",
                canoe: "🛶",
                capital_abcd: "🔠",
                capricorn: "♑️",
                car: "🚗",
                card_file_box: "🗃",
                card_index: "📇",
                card_index_dividers: "🗂",
                carousel_horse: "🎠",
                carrot: "🥕",
                cat: "🐱",
                cat2: "🐈",
                cd: "💿",
                chains: "⛓",
                champagne: "🍾",
                chart: "💹",
                chart_with_downwards_trend: "📉",
                chart_with_upwards_trend: "📈",
                checkered_flag: "🏁",
                cheese: "🧀",
                cherries: "🍒",
                cherry_blossom: "🌸",
                chestnut: "🌰",
                chicken: "🐔",
                children_crossing: "🚸",
                chipmunk: "🐿",
                chocolate_bar: "🍫",
                christmas_tree: "🎄",
                church: "⛪️",
                cinema: "🎦",
                circus_tent: "🎪",
                city_sunrise: "🌇",
                city_sunset: "🌆",
                cityscape: "🏙",
                cl: "🆑",
                clamp: "🗜",
                clap: "👏",
                clapper: "🎬",
                classical_building: "🏛",
                clinking_glasses: "🥂",
                clipboard: "📋",
                clock1: "🕐",
                clock10: "🕙",
                clock1030: "🕥",
                clock11: "🕚",
                clock1130: "🕦",
                clock12: "🕛",
                clock1230: "🕧",
                clock130: "🕜",
                clock2: "🕑",
                clock230: "🕝",
                clock3: "🕒",
                clock330: "🕞",
                clock4: "🕓",
                clock430: "🕟",
                clock5: "🕔",
                clock530: "🕠",
                clock6: "🕕",
                clock630: "🕡",
                clock7: "🕖",
                clock730: "🕢",
                clock8: "🕗",
                clock830: "🕣",
                clock9: "🕘",
                clock930: "🕤",
                closed_book: "📕",
                closed_lock_with_key: "🔐",
                closed_umbrella: "🌂",
                cloud: "☁️",
                cloud_with_lightning: "🌩",
                cloud_with_lightning_and_rain: "⛈",
                cloud_with_rain: "🌧",
                cloud_with_snow: "🌨",
                clown_face: "🤡",
                clubs: "♣️",
                cocktail: "🍸",
                coffee: "☕️",
                coffin: "⚰️",
                cold_sweat: "😰",
                comet: "☄️",
                computer: "💻",
                computer_mouse: "🖱",
                confetti_ball: "🎊",
                confounded: "😖",
                confused: "😕",
                congratulations: "㊗️",
                construction: "🚧",
                construction_worker_man: "👷",
                construction_worker_woman: "👷&zwj;♀️",
                control_knobs: "🎛",
                convenience_store: "🏪",
                cookie: "🍪",
                cool: "🆒",
                policeman: "👮",
                copyright: "©️",
                corn: "🌽",
                couch_and_lamp: "🛋",
                couple: "👫",
                couple_with_heart_woman_man: "💑",
                couple_with_heart_man_man: "👨&zwj;❤️&zwj;👨",
                couple_with_heart_woman_woman: "👩&zwj;❤️&zwj;👩",
                couplekiss_man_man: "👨&zwj;❤️&zwj;💋&zwj;👨",
                couplekiss_man_woman: "💏",
                couplekiss_woman_woman: "👩&zwj;❤️&zwj;💋&zwj;👩",
                cow: "🐮",
                cow2: "🐄",
                cowboy_hat_face: "🤠",
                crab: "🦀",
                crayon: "🖍",
                credit_card: "💳",
                crescent_moon: "🌙",
                cricket: "🏏",
                crocodile: "🐊",
                croissant: "🥐",
                crossed_fingers: "🤞",
                crossed_flags: "🎌",
                crossed_swords: "⚔️",
                crown: "👑",
                cry: "😢",
                crying_cat_face: "😿",
                crystal_ball: "🔮",
                cucumber: "🥒",
                cupid: "💘",
                curly_loop: "➰",
                currency_exchange: "💱",
                curry: "🍛",
                custard: "🍮",
                customs: "🛃",
                cyclone: "🌀",
                dagger: "🗡",
                dancer: "💃",
                dancing_women: "👯",
                dancing_men: "👯&zwj;♂️",
                dango: "🍡",
                dark_sunglasses: "🕶",
                dart: "🎯",
                dash: "💨",
                date: "📅",
                deciduous_tree: "🌳",
                deer: "🦌",
                department_store: "🏬",
                derelict_house: "🏚",
                desert: "🏜",
                desert_island: "🏝",
                desktop_computer: "🖥",
                male_detective: "🕵️",
                diamond_shape_with_a_dot_inside: "💠",
                diamonds: "♦️",
                disappointed: "😞",
                disappointed_relieved: "😥",
                dizzy: "💫",
                dizzy_face: "😵",
                do_not_litter: "🚯",
                dog: "🐶",
                dog2: "🐕",
                dollar: "💵",
                dolls: "🎎",
                dolphin: "🐬",
                door: "🚪",
                doughnut: "🍩",
                dove: "🕊",
                dragon: "🐉",
                dragon_face: "🐲",
                dress: "👗",
                dromedary_camel: "🐪",
                drooling_face: "🤤",
                droplet: "💧",
                drum: "🥁",
                duck: "🦆",
                dvd: "📀",
                "e-mail": "📧",
                eagle: "🦅",
                ear: "👂",
                ear_of_rice: "🌾",
                earth_africa: "🌍",
                earth_americas: "🌎",
                earth_asia: "🌏",
                egg: "🥚",
                eggplant: "🍆",
                eight_pointed_black_star: "✴️",
                eight_spoked_asterisk: "✳️",
                electric_plug: "🔌",
                elephant: "🐘",
                email: "✉️",
                end: "🔚",
                envelope_with_arrow: "📩",
                euro: "💶",
                european_castle: "🏰",
                european_post_office: "🏤",
                evergreen_tree: "🌲",
                exclamation: "❗️",
                expressionless: "😑",
                eye: "👁",
                eye_speech_bubble: "👁&zwj;🗨",
                eyeglasses: "👓",
                eyes: "👀",
                face_with_head_bandage: "🤕",
                face_with_thermometer: "🤒",
                fist_oncoming: "👊",
                factory: "🏭",
                fallen_leaf: "🍂",
                family_man_woman_boy: "👪",
                family_man_boy: "👨&zwj;👦",
                family_man_boy_boy: "👨&zwj;👦&zwj;👦",
                family_man_girl: "👨&zwj;👧",
                family_man_girl_boy: "👨&zwj;👧&zwj;👦",
                family_man_girl_girl: "👨&zwj;👧&zwj;👧",
                family_man_man_boy: "👨&zwj;👨&zwj;👦",
                family_man_man_boy_boy: "👨&zwj;👨&zwj;👦&zwj;👦",
                family_man_man_girl: "👨&zwj;👨&zwj;👧",
                family_man_man_girl_boy: "👨&zwj;👨&zwj;👧&zwj;👦",
                family_man_man_girl_girl: "👨&zwj;👨&zwj;👧&zwj;👧",
                family_man_woman_boy_boy: "👨&zwj;👩&zwj;👦&zwj;👦",
                family_man_woman_girl: "👨&zwj;👩&zwj;👧",
                family_man_woman_girl_boy: "👨&zwj;👩&zwj;👧&zwj;👦",
                family_man_woman_girl_girl: "👨&zwj;👩&zwj;👧&zwj;👧",
                family_woman_boy: "👩&zwj;👦",
                family_woman_boy_boy: "👩&zwj;👦&zwj;👦",
                family_woman_girl: "👩&zwj;👧",
                family_woman_girl_boy: "👩&zwj;👧&zwj;👦",
                family_woman_girl_girl: "👩&zwj;👧&zwj;👧",
                family_woman_woman_boy: "👩&zwj;👩&zwj;👦",
                family_woman_woman_boy_boy: "👩&zwj;👩&zwj;👦&zwj;👦",
                family_woman_woman_girl: "👩&zwj;👩&zwj;👧",
                family_woman_woman_girl_boy: "👩&zwj;👩&zwj;👧&zwj;👦",
                family_woman_woman_girl_girl: "👩&zwj;👩&zwj;👧&zwj;👧",
                fast_forward: "⏩",
                fax: "📠",
                fearful: "😨",
                feet: "🐾",
                female_detective: "🕵️&zwj;♀️",
                ferris_wheel: "🎡",
                ferry: "⛴",
                field_hockey: "🏑",
                file_cabinet: "🗄",
                file_folder: "📁",
                film_projector: "📽",
                film_strip: "🎞",
                fire: "🔥",
                fire_engine: "🚒",
                fireworks: "🎆",
                first_quarter_moon: "🌓",
                first_quarter_moon_with_face: "🌛",
                fish: "🐟",
                fish_cake: "🍥",
                fishing_pole_and_fish: "🎣",
                fist_raised: "✊",
                fist_left: "🤛",
                fist_right: "🤜",
                flags: "🎏",
                flashlight: "🔦",
                fleur_de_lis: "⚜️",
                flight_arrival: "🛬",
                flight_departure: "🛫",
                floppy_disk: "💾",
                flower_playing_cards: "🎴",
                flushed: "😳",
                fog: "🌫",
                foggy: "🌁",
                football: "🏈",
                footprints: "👣",
                fork_and_knife: "🍴",
                fountain: "⛲️",
                fountain_pen: "🖋",
                four_leaf_clover: "🍀",
                fox_face: "🦊",
                framed_picture: "🖼",
                free: "🆓",
                fried_egg: "🍳",
                fried_shrimp: "🍤",
                fries: "🍟",
                frog: "🐸",
                frowning: "😦",
                frowning_face: "☹️",
                frowning_man: "🙍&zwj;♂️",
                frowning_woman: "🙍",
                middle_finger: "🖕",
                fuelpump: "⛽️",
                full_moon: "🌕",
                full_moon_with_face: "🌝",
                funeral_urn: "⚱️",
                game_die: "🎲",
                gear: "⚙️",
                gem: "💎",
                gemini: "♊️",
                ghost: "👻",
                gift: "🎁",
                gift_heart: "💝",
                girl: "👧",
                globe_with_meridians: "🌐",
                goal_net: "🥅",
                goat: "🐐",
                golf: "⛳️",
                golfing_man: "🏌️",
                golfing_woman: "🏌️&zwj;♀️",
                gorilla: "🦍",
                grapes: "🍇",
                green_apple: "🍏",
                green_book: "📗",
                green_heart: "💚",
                green_salad: "🥗",
                grey_exclamation: "❕",
                grey_question: "❔",
                grimacing: "😬",
                grin: "😁",
                grinning: "😀",
                guardsman: "💂",
                guardswoman: "💂&zwj;♀️",
                guitar: "🎸",
                gun: "🔫",
                haircut_woman: "💇",
                haircut_man: "💇&zwj;♂️",
                hamburger: "🍔",
                hammer: "🔨",
                hammer_and_pick: "⚒",
                hammer_and_wrench: "🛠",
                hamster: "🐹",
                hand: "✋",
                handbag: "👜",
                handshake: "🤝",
                hankey: "💩",
                hatched_chick: "🐥",
                hatching_chick: "🐣",
                headphones: "🎧",
                hear_no_evil: "🙉",
                heart: "❤️",
                heart_decoration: "💟",
                heart_eyes: "😍",
                heart_eyes_cat: "😻",
                heartbeat: "💓",
                heartpulse: "💗",
                hearts: "♥️",
                heavy_check_mark: "✔️",
                heavy_division_sign: "➗",
                heavy_dollar_sign: "💲",
                heavy_heart_exclamation: "❣️",
                heavy_minus_sign: "➖",
                heavy_multiplication_x: "✖️",
                heavy_plus_sign: "➕",
                helicopter: "🚁",
                herb: "🌿",
                hibiscus: "🌺",
                high_brightness: "🔆",
                high_heel: "👠",
                hocho: "🔪",
                hole: "🕳",
                honey_pot: "🍯",
                horse: "🐴",
                horse_racing: "🏇",
                hospital: "🏥",
                hot_pepper: "🌶",
                hotdog: "🌭",
                hotel: "🏨",
                hotsprings: "♨️",
                hourglass: "⌛️",
                hourglass_flowing_sand: "⏳",
                house: "🏠",
                house_with_garden: "🏡",
                houses: "🏘",
                hugs: "🤗",
                hushed: "😯",
                ice_cream: "🍨",
                ice_hockey: "🏒",
                ice_skate: "⛸",
                icecream: "🍦",
                id: "🆔",
                ideograph_advantage: "🉐",
                imp: "👿",
                inbox_tray: "📥",
                incoming_envelope: "📨",
                tipping_hand_woman: "💁",
                information_source: "ℹ️",
                innocent: "😇",
                interrobang: "⁉️",
                iphone: "📱",
                izakaya_lantern: "🏮",
                jack_o_lantern: "🎃",
                japan: "🗾",
                japanese_castle: "🏯",
                japanese_goblin: "👺",
                japanese_ogre: "👹",
                jeans: "👖",
                joy: "😂",
                joy_cat: "😹",
                joystick: "🕹",
                kaaba: "🕋",
                key: "🔑",
                keyboard: "⌨️",
                keycap_ten: "🔟",
                kick_scooter: "🛴",
                kimono: "👘",
                kiss: "💋",
                kissing: "😗",
                kissing_cat: "😽",
                kissing_closed_eyes: "😚",
                kissing_heart: "😘",
                kissing_smiling_eyes: "😙",
                kiwi_fruit: "🥝",
                koala: "🐨",
                koko: "🈁",
                label: "🏷",
                large_blue_circle: "🔵",
                large_blue_diamond: "🔷",
                large_orange_diamond: "🔶",
                last_quarter_moon: "🌗",
                last_quarter_moon_with_face: "🌜",
                latin_cross: "✝️",
                laughing: "😆",
                leaves: "🍃",
                ledger: "📒",
                left_luggage: "🛅",
                left_right_arrow: "↔️",
                leftwards_arrow_with_hook: "↩️",
                lemon: "🍋",
                leo: "♌️",
                leopard: "🐆",
                level_slider: "🎚",
                libra: "♎️",
                light_rail: "🚈",
                link: "🔗",
                lion: "🦁",
                lips: "👄",
                lipstick: "💄",
                lizard: "🦎",
                lock: "🔒",
                lock_with_ink_pen: "🔏",
                lollipop: "🍭",
                loop: "➿",
                loud_sound: "🔊",
                loudspeaker: "📢",
                love_hotel: "🏩",
                love_letter: "💌",
                low_brightness: "🔅",
                lying_face: "🤥",
                m: "Ⓜ️",
                mag: "🔍",
                mag_right: "🔎",
                mahjong: "🀄️",
                mailbox: "📫",
                mailbox_closed: "📪",
                mailbox_with_mail: "📬",
                mailbox_with_no_mail: "📭",
                man: "👨",
                man_artist: "👨&zwj;🎨",
                man_astronaut: "👨&zwj;🚀",
                man_cartwheeling: "🤸&zwj;♂️",
                man_cook: "👨&zwj;🍳",
                man_dancing: "🕺",
                man_facepalming: "🤦&zwj;♂️",
                man_factory_worker: "👨&zwj;🏭",
                man_farmer: "👨&zwj;🌾",
                man_firefighter: "👨&zwj;🚒",
                man_health_worker: "👨&zwj;⚕️",
                man_in_tuxedo: "🤵",
                man_judge: "👨&zwj;⚖️",
                man_juggling: "🤹&zwj;♂️",
                man_mechanic: "👨&zwj;🔧",
                man_office_worker: "👨&zwj;💼",
                man_pilot: "👨&zwj;✈️",
                man_playing_handball: "🤾&zwj;♂️",
                man_playing_water_polo: "🤽&zwj;♂️",
                man_scientist: "👨&zwj;🔬",
                man_shrugging: "🤷&zwj;♂️",
                man_singer: "👨&zwj;🎤",
                man_student: "👨&zwj;🎓",
                man_teacher: "👨&zwj;🏫",
                man_technologist: "👨&zwj;💻",
                man_with_gua_pi_mao: "👲",
                man_with_turban: "👳",
                tangerine: "🍊",
                mans_shoe: "👞",
                mantelpiece_clock: "🕰",
                maple_leaf: "🍁",
                martial_arts_uniform: "🥋",
                mask: "😷",
                massage_woman: "💆",
                massage_man: "💆&zwj;♂️",
                meat_on_bone: "🍖",
                medal_military: "🎖",
                medal_sports: "🏅",
                mega: "📣",
                melon: "🍈",
                memo: "📝",
                men_wrestling: "🤼&zwj;♂️",
                menorah: "🕎",
                mens: "🚹",
                metal: "🤘",
                metro: "🚇",
                microphone: "🎤",
                microscope: "🔬",
                milk_glass: "🥛",
                milky_way: "🌌",
                minibus: "🚐",
                minidisc: "💽",
                mobile_phone_off: "📴",
                money_mouth_face: "🤑",
                money_with_wings: "💸",
                moneybag: "💰",
                monkey: "🐒",
                monkey_face: "🐵",
                monorail: "🚝",
                moon: "🌔",
                mortar_board: "🎓",
                mosque: "🕌",
                motor_boat: "🛥",
                motor_scooter: "🛵",
                motorcycle: "🏍",
                motorway: "🛣",
                mount_fuji: "🗻",
                mountain: "⛰",
                mountain_biking_man: "🚵",
                mountain_biking_woman: "🚵&zwj;♀️",
                mountain_cableway: "🚠",
                mountain_railway: "🚞",
                mountain_snow: "🏔",
                mouse: "🐭",
                mouse2: "🐁",
                movie_camera: "🎥",
                moyai: "🗿",
                mrs_claus: "🤶",
                muscle: "💪",
                mushroom: "🍄",
                musical_keyboard: "🎹",
                musical_note: "🎵",
                musical_score: "🎼",
                mute: "🔇",
                nail_care: "💅",
                name_badge: "📛",
                national_park: "🏞",
                nauseated_face: "🤢",
                necktie: "👔",
                negative_squared_cross_mark: "❎",
                nerd_face: "🤓",
                neutral_face: "😐",
                new: "🆕",
                new_moon: "🌑",
                new_moon_with_face: "🌚",
                newspaper: "📰",
                newspaper_roll: "🗞",
                next_track_button: "⏭",
                ng: "🆖",
                no_good_man: "🙅&zwj;♂️",
                no_good_woman: "🙅",
                night_with_stars: "🌃",
                no_bell: "🔕",
                no_bicycles: "🚳",
                no_entry: "⛔️",
                no_entry_sign: "🚫",
                no_mobile_phones: "📵",
                no_mouth: "😶",
                no_pedestrians: "🚷",
                no_smoking: "🚭",
                "non-potable_water": "🚱",
                nose: "👃",
                notebook: "📓",
                notebook_with_decorative_cover: "📔",
                notes: "🎶",
                nut_and_bolt: "🔩",
                o: "⭕️",
                o2: "🅾️",
                ocean: "🌊",
                octopus: "🐙",
                oden: "🍢",
                office: "🏢",
                oil_drum: "🛢",
                ok: "🆗",
                ok_hand: "👌",
                ok_man: "🙆&zwj;♂️",
                ok_woman: "🙆",
                old_key: "🗝",
                older_man: "👴",
                older_woman: "👵",
                om: "🕉",
                on: "🔛",
                oncoming_automobile: "🚘",
                oncoming_bus: "🚍",
                oncoming_police_car: "🚔",
                oncoming_taxi: "🚖",
                open_file_folder: "📂",
                open_hands: "👐",
                open_mouth: "😮",
                open_umbrella: "☂️",
                ophiuchus: "⛎",
                orange_book: "📙",
                orthodox_cross: "☦️",
                outbox_tray: "📤",
                owl: "🦉",
                ox: "🐂",
                package: "📦",
                page_facing_up: "📄",
                page_with_curl: "📃",
                pager: "📟",
                paintbrush: "🖌",
                palm_tree: "🌴",
                pancakes: "🥞",
                panda_face: "🐼",
                paperclip: "📎",
                paperclips: "🖇",
                parasol_on_ground: "⛱",
                parking: "🅿️",
                part_alternation_mark: "〽️",
                partly_sunny: "⛅️",
                passenger_ship: "🛳",
                passport_control: "🛂",
                pause_button: "⏸",
                peace_symbol: "☮️",
                peach: "🍑",
                peanuts: "🥜",
                pear: "🍐",
                pen: "🖊",
                pencil2: "✏️",
                penguin: "🐧",
                pensive: "😔",
                performing_arts: "🎭",
                persevere: "😣",
                person_fencing: "🤺",
                pouting_woman: "🙎",
                phone: "☎️",
                pick: "⛏",
                pig: "🐷",
                pig2: "🐖",
                pig_nose: "🐽",
                pill: "💊",
                pineapple: "🍍",
                ping_pong: "🏓",
                pisces: "♓️",
                pizza: "🍕",
                place_of_worship: "🛐",
                plate_with_cutlery: "🍽",
                play_or_pause_button: "⏯",
                point_down: "👇",
                point_left: "👈",
                point_right: "👉",
                point_up: "☝️",
                point_up_2: "👆",
                police_car: "🚓",
                policewoman: "👮&zwj;♀️",
                poodle: "🐩",
                popcorn: "🍿",
                post_office: "🏣",
                postal_horn: "📯",
                postbox: "📮",
                potable_water: "🚰",
                potato: "🥔",
                pouch: "👝",
                poultry_leg: "🍗",
                pound: "💷",
                rage: "😡",
                pouting_cat: "😾",
                pouting_man: "🙎&zwj;♂️",
                pray: "🙏",
                prayer_beads: "📿",
                pregnant_woman: "🤰",
                previous_track_button: "⏮",
                prince: "🤴",
                princess: "👸",
                printer: "🖨",
                purple_heart: "💜",
                purse: "👛",
                pushpin: "📌",
                put_litter_in_its_place: "🚮",
                question: "❓",
                rabbit: "🐰",
                rabbit2: "🐇",
                racehorse: "🐎",
                racing_car: "🏎",
                radio: "📻",
                radio_button: "🔘",
                radioactive: "☢️",
                railway_car: "🚃",
                railway_track: "🛤",
                rainbow: "🌈",
                rainbow_flag: "🏳️&zwj;🌈",
                raised_back_of_hand: "🤚",
                raised_hand_with_fingers_splayed: "🖐",
                raised_hands: "🙌",
                raising_hand_woman: "🙋",
                raising_hand_man: "🙋&zwj;♂️",
                ram: "🐏",
                ramen: "🍜",
                rat: "🐀",
                record_button: "⏺",
                recycle: "♻️",
                red_circle: "🔴",
                registered: "®️",
                relaxed: "☺️",
                relieved: "😌",
                reminder_ribbon: "🎗",
                repeat: "🔁",
                repeat_one: "🔂",
                rescue_worker_helmet: "⛑",
                restroom: "🚻",
                revolving_hearts: "💞",
                rewind: "⏪",
                rhinoceros: "🦏",
                ribbon: "🎀",
                rice: "🍚",
                rice_ball: "🍙",
                rice_cracker: "🍘",
                rice_scene: "🎑",
                right_anger_bubble: "🗯",
                ring: "💍",
                robot: "🤖",
                rocket: "🚀",
                rofl: "🤣",
                roll_eyes: "🙄",
                roller_coaster: "🎢",
                rooster: "🐓",
                rose: "🌹",
                rosette: "🏵",
                rotating_light: "🚨",
                round_pushpin: "📍",
                rowing_man: "🚣",
                rowing_woman: "🚣&zwj;♀️",
                rugby_football: "🏉",
                running_man: "🏃",
                running_shirt_with_sash: "🎽",
                running_woman: "🏃&zwj;♀️",
                sa: "🈂️",
                sagittarius: "♐️",
                sake: "🍶",
                sandal: "👡",
                santa: "🎅",
                satellite: "📡",
                saxophone: "🎷",
                school: "🏫",
                school_satchel: "🎒",
                scissors: "✂️",
                scorpion: "🦂",
                scorpius: "♏️",
                scream: "😱",
                scream_cat: "🙀",
                scroll: "📜",
                seat: "💺",
                secret: "㊙️",
                see_no_evil: "🙈",
                seedling: "🌱",
                selfie: "🤳",
                shallow_pan_of_food: "🥘",
                shamrock: "☘️",
                shark: "🦈",
                shaved_ice: "🍧",
                sheep: "🐑",
                shell: "🐚",
                shield: "🛡",
                shinto_shrine: "⛩",
                ship: "🚢",
                shirt: "👕",
                shopping: "🛍",
                shopping_cart: "🛒",
                shower: "🚿",
                shrimp: "🦐",
                signal_strength: "📶",
                six_pointed_star: "🔯",
                ski: "🎿",
                skier: "⛷",
                skull: "💀",
                skull_and_crossbones: "☠️",
                sleeping: "😴",
                sleeping_bed: "🛌",
                sleepy: "😪",
                slightly_frowning_face: "🙁",
                slightly_smiling_face: "🙂",
                slot_machine: "🎰",
                small_airplane: "🛩",
                small_blue_diamond: "🔹",
                small_orange_diamond: "🔸",
                small_red_triangle: "🔺",
                small_red_triangle_down: "🔻",
                smile: "😄",
                smile_cat: "😸",
                smiley: "😃",
                smiley_cat: "😺",
                smiling_imp: "😈",
                smirk: "😏",
                smirk_cat: "😼",
                smoking: "🚬",
                snail: "🐌",
                snake: "🐍",
                sneezing_face: "🤧",
                snowboarder: "🏂",
                snowflake: "❄️",
                snowman: "⛄️",
                snowman_with_snow: "☃️",
                sob: "😭",
                soccer: "⚽️",
                soon: "🔜",
                sos: "🆘",
                sound: "🔉",
                space_invader: "👾",
                spades: "♠️",
                spaghetti: "🍝",
                sparkle: "❇️",
                sparkler: "🎇",
                sparkles: "✨",
                sparkling_heart: "💖",
                speak_no_evil: "🙊",
                speaker: "🔈",
                speaking_head: "🗣",
                speech_balloon: "💬",
                speedboat: "🚤",
                spider: "🕷",
                spider_web: "🕸",
                spiral_calendar: "🗓",
                spiral_notepad: "🗒",
                spoon: "🥄",
                squid: "🦑",
                stadium: "🏟",
                star: "⭐️",
                star2: "🌟",
                star_and_crescent: "☪️",
                star_of_david: "✡️",
                stars: "🌠",
                station: "🚉",
                statue_of_liberty: "🗽",
                steam_locomotive: "🚂",
                stew: "🍲",
                stop_button: "⏹",
                stop_sign: "🛑",
                stopwatch: "⏱",
                straight_ruler: "📏",
                strawberry: "🍓",
                stuck_out_tongue: "😛",
                stuck_out_tongue_closed_eyes: "😝",
                stuck_out_tongue_winking_eye: "😜",
                studio_microphone: "🎙",
                stuffed_flatbread: "🥙",
                sun_behind_large_cloud: "🌥",
                sun_behind_rain_cloud: "🌦",
                sun_behind_small_cloud: "🌤",
                sun_with_face: "🌞",
                sunflower: "🌻",
                sunglasses: "😎",
                sunny: "☀️",
                sunrise: "🌅",
                sunrise_over_mountains: "🌄",
                surfing_man: "🏄",
                surfing_woman: "🏄&zwj;♀️",
                sushi: "🍣",
                suspension_railway: "🚟",
                sweat: "😓",
                sweat_drops: "💦",
                sweat_smile: "😅",
                sweet_potato: "🍠",
                swimming_man: "🏊",
                swimming_woman: "🏊&zwj;♀️",
                symbols: "🔣",
                synagogue: "🕍",
                syringe: "💉",
                taco: "🌮",
                tada: "🎉",
                tanabata_tree: "🎋",
                taurus: "♉️",
                taxi: "🚕",
                tea: "🍵",
                telephone_receiver: "📞",
                telescope: "🔭",
                tennis: "🎾",
                tent: "⛺️",
                thermometer: "🌡",
                thinking: "🤔",
                thought_balloon: "💭",
                ticket: "🎫",
                tickets: "🎟",
                tiger: "🐯",
                tiger2: "🐅",
                timer_clock: "⏲",
                tipping_hand_man: "💁&zwj;♂️",
                tired_face: "😫",
                tm: "™️",
                toilet: "🚽",
                tokyo_tower: "🗼",
                tomato: "🍅",
                tongue: "👅",
                top: "🔝",
                tophat: "🎩",
                tornado: "🌪",
                trackball: "🖲",
                tractor: "🚜",
                traffic_light: "🚥",
                train: "🚋",
                train2: "🚆",
                tram: "🚊",
                triangular_flag_on_post: "🚩",
                triangular_ruler: "📐",
                trident: "🔱",
                triumph: "😤",
                trolleybus: "🚎",
                trophy: "🏆",
                tropical_drink: "🍹",
                tropical_fish: "🐠",
                truck: "🚚",
                trumpet: "🎺",
                tulip: "🌷",
                tumbler_glass: "🥃",
                turkey: "🦃",
                turtle: "🐢",
                tv: "📺",
                twisted_rightwards_arrows: "🔀",
                two_hearts: "💕",
                two_men_holding_hands: "👬",
                two_women_holding_hands: "👭",
                u5272: "🈹",
                u5408: "🈴",
                u55b6: "🈺",
                u6307: "🈯️",
                u6708: "🈷️",
                u6709: "🈶",
                u6e80: "🈵",
                u7121: "🈚️",
                u7533: "🈸",
                u7981: "🈲",
                u7a7a: "🈳",
                umbrella: "☔️",
                unamused: "😒",
                underage: "🔞",
                unicorn: "🦄",
                unlock: "🔓",
                up: "🆙",
                upside_down_face: "🙃",
                v: "✌️",
                vertical_traffic_light: "🚦",
                vhs: "📼",
                vibration_mode: "📳",
                video_camera: "📹",
                video_game: "🎮",
                violin: "🎻",
                virgo: "♍️",
                volcano: "🌋",
                volleyball: "🏐",
                vs: "🆚",
                vulcan_salute: "🖖",
                walking_man: "🚶",
                walking_woman: "🚶&zwj;♀️",
                waning_crescent_moon: "🌘",
                waning_gibbous_moon: "🌖",
                warning: "⚠️",
                wastebasket: "🗑",
                watch: "⌚️",
                water_buffalo: "🐃",
                watermelon: "🍉",
                wave: "👋",
                wavy_dash: "〰️",
                waxing_crescent_moon: "🌒",
                wc: "🚾",
                weary: "😩",
                wedding: "💒",
                weight_lifting_man: "🏋️",
                weight_lifting_woman: "🏋️&zwj;♀️",
                whale: "🐳",
                whale2: "🐋",
                wheel_of_dharma: "☸️",
                wheelchair: "♿️",
                white_check_mark: "✅",
                white_circle: "⚪️",
                white_flag: "🏳️",
                white_flower: "💮",
                white_large_square: "⬜️",
                white_medium_small_square: "◽️",
                white_medium_square: "◻️",
                white_small_square: "▫️",
                white_square_button: "🔳",
                wilted_flower: "🥀",
                wind_chime: "🎐",
                wind_face: "🌬",
                wine_glass: "🍷",
                wink: "😉",
                wolf: "🐺",
                woman: "👩",
                woman_artist: "👩&zwj;🎨",
                woman_astronaut: "👩&zwj;🚀",
                woman_cartwheeling: "🤸&zwj;♀️",
                woman_cook: "👩&zwj;🍳",
                woman_facepalming: "🤦&zwj;♀️",
                woman_factory_worker: "👩&zwj;🏭",
                woman_farmer: "👩&zwj;🌾",
                woman_firefighter: "👩&zwj;🚒",
                woman_health_worker: "👩&zwj;⚕️",
                woman_judge: "👩&zwj;⚖️",
                woman_juggling: "🤹&zwj;♀️",
                woman_mechanic: "👩&zwj;🔧",
                woman_office_worker: "👩&zwj;💼",
                woman_pilot: "👩&zwj;✈️",
                woman_playing_handball: "🤾&zwj;♀️",
                woman_playing_water_polo: "🤽&zwj;♀️",
                woman_scientist: "👩&zwj;🔬",
                woman_shrugging: "🤷&zwj;♀️",
                woman_singer: "👩&zwj;🎤",
                woman_student: "👩&zwj;🎓",
                woman_teacher: "👩&zwj;🏫",
                woman_technologist: "👩&zwj;💻",
                woman_with_turban: "👳&zwj;♀️",
                womans_clothes: "👚",
                womans_hat: "👒",
                women_wrestling: "🤼&zwj;♀️",
                womens: "🚺",
                world_map: "🗺",
                worried: "😟",
                wrench: "🔧",
                writing_hand: "✍️",
                x: "❌",
                yellow_heart: "💛",
                yen: "💴",
                yin_yang: "☯️",
                yum: "😋",
                zap: "⚡️",
                zipper_mouth_face: "🤐",
                zzz: "💤",
                octocat: '<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',
                showdown: "<span style=\"font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;\">S</span>"
            }, i.Converter = function (e) {
                var t = {}, n = [], l = [], d = {}, u = a, h = {parsed: {}, raw: "", format: ""};

                function p(e, t) {
                    if (t = t || null, i.helper.isString(e)) {
                        if (t = e = i.helper.stdExtName(e), i.extensions[e]) return console.warn("DEPRECATION WARNING: " + e + " is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"), void function (e, t) {
                            "function" == typeof e && (e = e(new i.Converter));
                            i.helper.isArray(e) || (e = [e]);
                            var o = c(e, t);
                            if (!o.valid) throw Error(o.error);
                            for (var r = 0; r < e.length; ++r) switch (e[r].type) {
                                case"lang":
                                    n.push(e[r]);
                                    break;
                                case"output":
                                    l.push(e[r]);
                                    break;
                                default:
                                    throw Error("Extension loader error: Type unrecognized!!!")
                            }
                        }(i.extensions[e], e);
                        if (i.helper.isUndefined(o[e])) throw Error('Extension "' + e + '" could not be loaded. It was either not found or is not a valid extension.');
                        e = o[e]
                    }
                    "function" == typeof e && (e = e()), i.helper.isArray(e) || (e = [e]);
                    var r = c(e, t);
                    if (!r.valid) throw Error(r.error);
                    for (var a = 0; a < e.length; ++a) {
                        switch (e[a].type) {
                            case"lang":
                                n.push(e[a]);
                                break;
                            case"output":
                                l.push(e[a])
                        }
                        if (e[a].hasOwnProperty("listeners")) for (var s in e[a].listeners) e[a].listeners.hasOwnProperty(s) && m(s, e[a].listeners[s])
                    }
                }

                function m(e, t) {
                    if (!i.helper.isString(e)) throw Error("Invalid argument in converter.listen() method: name must be a string, but " + typeof e + " given");
                    if ("function" != typeof t) throw Error("Invalid argument in converter.listen() method: callback must be a function, but " + typeof t + " given");
                    d.hasOwnProperty(e) || (d[e] = []), d[e].push(t)
                }

                !function () {
                    for (var n in e = e || {}, r) r.hasOwnProperty(n) && (t[n] = r[n]);
                    if ("object" != typeof e) throw Error("Converter expects the passed parameter to be an object, but " + typeof e + " was passed instead.");
                    for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
                    t.extensions && i.helper.forEach(t.extensions, p)
                }(), this._dispatch = function (e, t, i, n) {
                    if (d.hasOwnProperty(e)) for (var o = 0; o < d[e].length; ++o) {
                        var r = d[e][o](e, t, this, i, n);
                        r && void 0 !== r && (t = r)
                    }
                    return t
                }, this.listen = function (e, t) {
                    return m(e, t), this
                }, this.makeHtml = function (e) {
                    if (!e) return e;
                    var o = {
                        gHtmlBlocks: [],
                        gHtmlMdBlocks: [],
                        gHtmlSpans: [],
                        gUrls: {},
                        gTitles: {},
                        gDimensions: {},
                        gListLevel: 0,
                        hashLinkCounts: {},
                        langExtensions: n,
                        outputModifiers: l,
                        converter: this,
                        ghCodeBlocks: [],
                        metadata: {parsed: {}, raw: "", format: ""}
                    };
                    return e = (e = (e = (e = (e = e.replace(/¨/g, "¨T")).replace(/\$/g, "¨D")).replace(/\r\n/g, "\n")).replace(/\r/g, "\n")).replace(/\u00A0/g, "&nbsp;"), t.smartIndentationFix && (e = function (e) {
                        var t = e.match(/^\s*/)[0].length, i = new RegExp("^\\s{0," + t + "}", "gm");
                        return e.replace(i, "")
                    }(e)), e = "\n\n" + e + "\n\n", e = (e = i.subParser("detab")(e, t, o)).replace(/^[ \t]+$/gm, ""), i.helper.forEach(n, (function (n) {
                        e = i.subParser("runExtension")(n, e, t, o)
                    })), e = i.subParser("metadata")(e, t, o), e = i.subParser("hashPreCodeTags")(e, t, o), e = i.subParser("githubCodeBlocks")(e, t, o), e = i.subParser("hashHTMLBlocks")(e, t, o), e = i.subParser("hashCodeTags")(e, t, o), e = i.subParser("stripLinkDefinitions")(e, t, o), e = i.subParser("blockGamut")(e, t, o), e = i.subParser("unhashHTMLSpans")(e, t, o), e = (e = (e = i.subParser("unescapeSpecialChars")(e, t, o)).replace(/¨D/g, "$$")).replace(/¨T/g, "¨"), e = i.subParser("completeHTMLDocument")(e, t, o), i.helper.forEach(l, (function (n) {
                        e = i.subParser("runExtension")(n, e, t, o)
                    })), h = o.metadata, e
                }, this.makeMarkdown = this.makeMd = function (e, t) {
                    if (e = (e = (e = e.replace(/\r\n/g, "\n")).replace(/\r/g, "\n")).replace(/>[ \t]+</, ">¨NBSP;<"), !t) {
                        if (!window || !window.document) throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");
                        t = window.document
                    }
                    var n = t.createElement("div");
                    n.innerHTML = e;
                    var o = {
                        preList: function (e) {
                            for (var t = e.querySelectorAll("pre"), n = [], o = 0; o < t.length; ++o) if (1 === t[o].childElementCount && "code" === t[o].firstChild.tagName.toLowerCase()) {
                                var r = t[o].firstChild.innerHTML.trim(),
                                    a = t[o].firstChild.getAttribute("data-language") || "";
                                if ("" === a) for (var s = t[o].firstChild.className.split(" "), c = 0; c < s.length; ++c) {
                                    var l = s[c].match(/^language-(.+)$/);
                                    if (null !== l) {
                                        a = l[1];
                                        break
                                    }
                                }
                                r = i.helper.unescapeHTMLEntities(r), n.push(r), t[o].outerHTML = '<precode language="' + a + '" precodenum="' + o.toString() + '"></precode>'
                            } else n.push(t[o].innerHTML), t[o].innerHTML = "", t[o].setAttribute("prenum", o.toString());
                            return n
                        }(n)
                    };
                    !function e(t) {
                        for (var i = 0; i < t.childNodes.length; ++i) {
                            var n = t.childNodes[i];
                            3 === n.nodeType ? /\S/.test(n.nodeValue) ? (n.nodeValue = n.nodeValue.split("\n").join(" "), n.nodeValue = n.nodeValue.replace(/(\s)+/g, "$1")) : (t.removeChild(n), --i) : 1 === n.nodeType && e(n)
                        }
                    }(n);
                    for (var r = n.childNodes, a = "", s = 0; s < r.length; s++) a += i.subParser("makeMarkdown.node")(r[s], o);
                    return a
                }, this.setOption = function (e, i) {
                    t[e] = i
                }, this.getOption = function (e) {
                    return t[e]
                }, this.getOptions = function () {
                    return t
                }, this.addExtension = function (e, t) {
                    p(e, t = t || null)
                }, this.useExtension = function (e) {
                    p(e)
                }, this.setFlavor = function (e) {
                    if (!s.hasOwnProperty(e)) throw Error(e + " flavor was not found");
                    var i = s[e];
                    for (var n in u = e, i) i.hasOwnProperty(n) && (t[n] = i[n])
                }, this.getFlavor = function () {
                    return u
                }, this.removeExtension = function (e) {
                    i.helper.isArray(e) || (e = [e]);
                    for (var t = 0; t < e.length; ++t) {
                        for (var o = e[t], r = 0; r < n.length; ++r) n[r] === o && n[r].splice(r, 1);
                        for (; 0 < l.length; ++r) l[0] === o && l[0].splice(r, 1)
                    }
                }, this.getAllExtensions = function () {
                    return {language: n, output: l}
                }, this.getMetadata = function (e) {
                    return e ? h.raw : h.parsed
                }, this.getMetadataFormat = function () {
                    return h.format
                }, this._setMetadataPair = function (e, t) {
                    h.parsed[e] = t
                }, this._setMetadataFormat = function (e) {
                    h.format = e
                }, this._setMetadataRaw = function (e) {
                    h.raw = e
                }
            }, i.subParser("anchors", (function (e, t, n) {
                var o = function (e, o, r, a, s, c, l) {
                    if (i.helper.isUndefined(l) && (l = ""), r = r.toLowerCase(), e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) a = ""; else if (!a) {
                        if (r || (r = o.toLowerCase().replace(/ ?\n/g, " ")), a = "#" + r, i.helper.isUndefined(n.gUrls[r])) return e;
                        a = n.gUrls[r], i.helper.isUndefined(n.gTitles[r]) || (l = n.gTitles[r])
                    }
                    var d = '<a href="' + (a = a.replace(i.helper.regexes.asteriskDashAndColon, i.helper.escapeCharactersCallback)) + '"';
                    return "" !== l && null !== l && (d += ' title="' + (l = (l = l.replace(/"/g, "&quot;")).replace(i.helper.regexes.asteriskDashAndColon, i.helper.escapeCharactersCallback)) + '"'), t.openLinksInNewWindow && !/^#/.test(a) && (d += ' rel="noopener noreferrer" target="¨E95Eblank"'), d += ">" + o + "</a>"
                };
                return e = (e = (e = (e = (e = n.converter._dispatch("anchors.before", e, t, n)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g, o)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g, o)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g, o)).replace(/\[([^\[\]]+)]()()()()()/g, o), t.ghMentions && (e = e.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gim, (function (e, n, o, r, a) {
                    if ("\\" === o) return n + r;
                    if (!i.helper.isString(t.ghMentionsLink)) throw new Error("ghMentionsLink option must be a string");
                    var s = t.ghMentionsLink.replace(/\{u}/g, a), c = "";
                    return t.openLinksInNewWindow && (c = ' rel="noopener noreferrer" target="¨E95Eblank"'), n + '<a href="' + s + '"' + c + ">" + r + "</a>"
                }))), e = n.converter._dispatch("anchors.after", e, t, n)
            }));
            var u = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,
                h = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,
                p = /()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,
                m = /(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,
                f = /<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi, g = function (e) {
                    return function (t, n, o, r, a, s, c) {
                        var l = o = o.replace(i.helper.regexes.asteriskDashAndColon, i.helper.escapeCharactersCallback),
                            d = "", u = "", h = n || "", p = c || "";
                        return /^www\./i.test(o) && (o = o.replace(/^www\./i, "http://www.")), e.excludeTrailingPunctuationFromURLs && s && (d = s), e.openLinksInNewWindow && (u = ' rel="noopener noreferrer" target="¨E95Eblank"'), h + '<a href="' + o + '"' + u + ">" + l + "</a>" + d + p
                    }
                }, b = function (e, t) {
                    return function (n, o, r) {
                        var a = "mailto:";
                        return o = o || "", r = i.subParser("unescapeSpecialChars")(r, e, t), e.encodeEmails ? (a = i.helper.encodeEmailAddress(a + r), r = i.helper.encodeEmailAddress(r)) : a += r, o + '<a href="' + a + '">' + r + "</a>"
                    }
                };
            i.subParser("autoLinks", (function (e, t, i) {
                return e = (e = (e = i.converter._dispatch("autoLinks.before", e, t, i)).replace(p, g(t))).replace(f, b(t, i)), e = i.converter._dispatch("autoLinks.after", e, t, i)
            })), i.subParser("simplifiedAutoLinks", (function (e, t, i) {
                return t.simplifiedAutoLink ? (e = i.converter._dispatch("simplifiedAutoLinks.before", e, t, i), e = (e = t.excludeTrailingPunctuationFromURLs ? e.replace(h, g(t)) : e.replace(u, g(t))).replace(m, b(t, i)), e = i.converter._dispatch("simplifiedAutoLinks.after", e, t, i)) : e
            })), i.subParser("blockGamut", (function (e, t, n) {
                return e = n.converter._dispatch("blockGamut.before", e, t, n), e = i.subParser("blockQuotes")(e, t, n), e = i.subParser("headers")(e, t, n), e = i.subParser("horizontalRule")(e, t, n), e = i.subParser("lists")(e, t, n), e = i.subParser("codeBlocks")(e, t, n), e = i.subParser("tables")(e, t, n), e = i.subParser("hashHTMLBlocks")(e, t, n), e = i.subParser("paragraphs")(e, t, n), e = n.converter._dispatch("blockGamut.after", e, t, n)
            })), i.subParser("blockQuotes", (function (e, t, n) {
                e = n.converter._dispatch("blockQuotes.before", e, t, n), e += "\n\n";
                var o = /(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;
                return t.splitAdjacentBlockquotes && (o = /^ {0,3}>[\s\S]*?(?:\n\n)/gm), e = e.replace(o, (function (e) {
                    return e = (e = (e = e.replace(/^[ \t]*>[ \t]?/gm, "")).replace(/¨0/g, "")).replace(/^[ \t]+$/gm, ""), e = i.subParser("githubCodeBlocks")(e, t, n), e = (e = (e = i.subParser("blockGamut")(e, t, n)).replace(/(^|\n)/g, "$1  ")).replace(/(\s*<pre>[^\r]+?<\/pre>)/gm, (function (e, t) {
                        var i = t;
                        return i = (i = i.replace(/^  /gm, "¨0")).replace(/¨0/g, "")
                    })), i.subParser("hashBlock")("<blockquote>\n" + e + "\n</blockquote>", t, n)
                })), e = n.converter._dispatch("blockQuotes.after", e, t, n)
            })), i.subParser("codeBlocks", (function (e, t, n) {
                e = n.converter._dispatch("codeBlocks.before", e, t, n);
                return e = (e = (e += "¨0").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g, (function (e, o, r) {
                    var a = o, s = r, c = "\n";
                    return a = i.subParser("outdent")(a, t, n), a = i.subParser("encodeCode")(a, t, n), a = (a = (a = i.subParser("detab")(a, t, n)).replace(/^\n+/g, "")).replace(/\n+$/g, ""), t.omitExtraWLInCodeBlocks && (c = ""), a = "<pre><code>" + a + c + "</code></pre>", i.subParser("hashBlock")(a, t, n) + s
                }))).replace(/¨0/, ""), e = n.converter._dispatch("codeBlocks.after", e, t, n)
            })), i.subParser("codeSpans", (function (e, t, n) {
                return void 0 === (e = n.converter._dispatch("codeSpans.before", e, t, n)) && (e = ""), e = e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm, (function (e, o, r, a) {
                    var s = a;
                    return s = (s = s.replace(/^([ \t]*)/g, "")).replace(/[ \t]*$/g, ""), s = o + "<code>" + (s = i.subParser("encodeCode")(s, t, n)) + "</code>", s = i.subParser("hashHTMLSpans")(s, t, n)
                })), e = n.converter._dispatch("codeSpans.after", e, t, n)
            })), i.subParser("completeHTMLDocument", (function (e, t, i) {
                if (!t.completeHTMLDocument) return e;
                e = i.converter._dispatch("completeHTMLDocument.before", e, t, i);
                var n = "html", o = "<!DOCTYPE HTML>\n", r = "", a = '<meta charset="utf-8">\n', s = "", c = "";
                for (var l in void 0 !== i.metadata.parsed.doctype && (o = "<!DOCTYPE " + i.metadata.parsed.doctype + ">\n", "html" !== (n = i.metadata.parsed.doctype.toString().toLowerCase()) && "html5" !== n || (a = '<meta charset="utf-8">')), i.metadata.parsed) if (i.metadata.parsed.hasOwnProperty(l)) switch (l.toLowerCase()) {
                    case"doctype":
                        break;
                    case"title":
                        r = "<title>" + i.metadata.parsed.title + "</title>\n";
                        break;
                    case"charset":
                        a = "html" === n || "html5" === n ? '<meta charset="' + i.metadata.parsed.charset + '">\n' : '<meta name="charset" content="' + i.metadata.parsed.charset + '">\n';
                        break;
                    case"language":
                    case"lang":
                        s = ' lang="' + i.metadata.parsed[l] + '"', c += '<meta name="' + l + '" content="' + i.metadata.parsed[l] + '">\n';
                        break;
                    default:
                        c += '<meta name="' + l + '" content="' + i.metadata.parsed[l] + '">\n'
                }
                return e = o + "<html" + s + ">\n<head>\n" + r + a + c + "</head>\n<body>\n" + e.trim() + "\n</body>\n</html>", e = i.converter._dispatch("completeHTMLDocument.after", e, t, i)
            })), i.subParser("detab", (function (e, t, i) {
                return e = (e = (e = (e = (e = (e = i.converter._dispatch("detab.before", e, t, i)).replace(/\t(?=\t)/g, "    ")).replace(/\t/g, "¨A¨B")).replace(/¨B(.+?)¨A/g, (function (e, t) {
                    for (var i = t, n = 4 - i.length % 4, o = 0; o < n; o++) i += " ";
                    return i
                }))).replace(/¨A/g, "    ")).replace(/¨B/g, ""), e = i.converter._dispatch("detab.after", e, t, i)
            })), i.subParser("ellipsis", (function (e, t, i) {
                return e = (e = i.converter._dispatch("ellipsis.before", e, t, i)).replace(/\.\.\./g, "…"), e = i.converter._dispatch("ellipsis.after", e, t, i)
            })), i.subParser("emoji", (function (e, t, n) {
                if (!t.emoji) return e;
                return e = (e = n.converter._dispatch("emoji.before", e, t, n)).replace(/:([\S]+?):/g, (function (e, t) {
                    return i.helper.emojis.hasOwnProperty(t) ? i.helper.emojis[t] : e
                })), e = n.converter._dispatch("emoji.after", e, t, n)
            })), i.subParser("encodeAmpsAndAngles", (function (e, t, i) {
                return e = (e = (e = (e = (e = i.converter._dispatch("encodeAmpsAndAngles.before", e, t, i)).replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&amp;")).replace(/<(?![a-z\/?$!])/gi, "&lt;")).replace(/</g, "&lt;")).replace(/>/g, "&gt;"), e = i.converter._dispatch("encodeAmpsAndAngles.after", e, t, i)
            })), i.subParser("encodeBackslashEscapes", (function (e, t, n) {
                return e = (e = (e = n.converter._dispatch("encodeBackslashEscapes.before", e, t, n)).replace(/\\(\\)/g, i.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+.!~=|-])/g, i.helper.escapeCharactersCallback), e = n.converter._dispatch("encodeBackslashEscapes.after", e, t, n)
            })), i.subParser("encodeCode", (function (e, t, n) {
                return e = (e = n.converter._dispatch("encodeCode.before", e, t, n)).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/([*_{}\[\]\\=~-])/g, i.helper.escapeCharactersCallback), e = n.converter._dispatch("encodeCode.after", e, t, n)
            })), i.subParser("escapeSpecialCharsWithinTagAttributes", (function (e, t, n) {
                return e = (e = (e = n.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before", e, t, n)).replace(/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi, (function (e) {
                    return e.replace(/(.)<\/?code>(?=.)/g, "$1`").replace(/([\\`*_~=|])/g, i.helper.escapeCharactersCallback)
                }))).replace(/<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi, (function (e) {
                    return e.replace(/([\\`*_~=|])/g, i.helper.escapeCharactersCallback)
                })), e = n.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after", e, t, n)
            })), i.subParser("githubCodeBlocks", (function (e, t, n) {
                return t.ghCodeBlocks ? (e = n.converter._dispatch("githubCodeBlocks.before", e, t, n), e = (e = (e += "¨0").replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g, (function (e, o, r, a) {
                    var s = t.omitExtraWLInCodeBlocks ? "" : "\n";
                    return a = i.subParser("encodeCode")(a, t, n), a = "<pre><code" + (r ? ' class="' + r + " language-" + r + '"' : "") + ">" + (a = (a = (a = i.subParser("detab")(a, t, n)).replace(/^\n+/g, "")).replace(/\n+$/g, "")) + s + "</code></pre>", a = i.subParser("hashBlock")(a, t, n), "\n\n¨G" + (n.ghCodeBlocks.push({
                        text: e,
                        codeblock: a
                    }) - 1) + "G\n\n"
                }))).replace(/¨0/, ""), n.converter._dispatch("githubCodeBlocks.after", e, t, n)) : e
            })), i.subParser("hashBlock", (function (e, t, i) {
                return e = (e = i.converter._dispatch("hashBlock.before", e, t, i)).replace(/(^\n+|\n+$)/g, ""), e = "\n\n¨K" + (i.gHtmlBlocks.push(e) - 1) + "K\n\n", e = i.converter._dispatch("hashBlock.after", e, t, i)
            })), i.subParser("hashCodeTags", (function (e, t, n) {
                e = n.converter._dispatch("hashCodeTags.before", e, t, n);
                return e = i.helper.replaceRecursiveRegExp(e, (function (e, o, r, a) {
                    var s = r + i.subParser("encodeCode")(o, t, n) + a;
                    return "¨C" + (n.gHtmlSpans.push(s) - 1) + "C"
                }), "<code\\b[^>]*>", "</code>", "gim"), e = n.converter._dispatch("hashCodeTags.after", e, t, n)
            })), i.subParser("hashElement", (function (e, t, i) {
                return function (e, t) {
                    var n = t;
                    return n = (n = (n = n.replace(/\n\n/g, "\n")).replace(/^\n/, "")).replace(/\n+$/g, ""), n = "\n\n¨K" + (i.gHtmlBlocks.push(n) - 1) + "K\n\n"
                }
            })), i.subParser("hashHTMLBlocks", (function (e, t, n) {
                e = n.converter._dispatch("hashHTMLBlocks.before", e, t, n);
                var o = ["pre", "div", "h1", "h2", "h3", "h4", "h5", "h6", "blockquote", "table", "dl", "ol", "ul", "script", "noscript", "form", "fieldset", "iframe", "math", "style", "section", "header", "footer", "nav", "article", "aside", "address", "audio", "canvas", "figure", "hgroup", "output", "video", "p"],
                    r = function (e, t, i, o) {
                        var r = e;
                        return -1 !== i.search(/\bmarkdown\b/) && (r = i + n.converter.makeHtml(t) + o), "\n\n¨K" + (n.gHtmlBlocks.push(r) - 1) + "K\n\n"
                    };
                t.backslashEscapesHTMLTags && (e = e.replace(/\\<(\/?[^>]+?)>/g, (function (e, t) {
                    return "&lt;" + t + "&gt;"
                })));
                for (var a = 0; a < o.length; ++a) for (var s, c = new RegExp("^ {0,3}(<" + o[a] + "\\b[^>]*>)", "im"), l = "<" + o[a] + "\\b[^>]*>", d = "</" + o[a] + ">"; -1 !== (s = i.helper.regexIndexOf(e, c));) {
                    var u = i.helper.splitAtIndex(e, s), h = i.helper.replaceRecursiveRegExp(u[1], r, l, d, "im");
                    if (h === u[1]) break;
                    e = u[0].concat(h)
                }
                return e = e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g, i.subParser("hashElement")(e, t, n)), e = (e = i.helper.replaceRecursiveRegExp(e, (function (e) {
                    return "\n\n¨K" + (n.gHtmlBlocks.push(e) - 1) + "K\n\n"
                }), "^ {0,3}\x3c!--", "--\x3e", "gm")).replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g, i.subParser("hashElement")(e, t, n)), e = n.converter._dispatch("hashHTMLBlocks.after", e, t, n)
            })), i.subParser("hashHTMLSpans", (function (e, t, i) {
                function n(e) {
                    return "¨C" + (i.gHtmlSpans.push(e) - 1) + "C"
                }

                return e = (e = (e = (e = (e = i.converter._dispatch("hashHTMLSpans.before", e, t, i)).replace(/<[^>]+?\/>/gi, (function (e) {
                    return n(e)
                }))).replace(/<([^>]+?)>[\s\S]*?<\/\1>/g, (function (e) {
                    return n(e)
                }))).replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g, (function (e) {
                    return n(e)
                }))).replace(/<[^>]+?>/gi, (function (e) {
                    return n(e)
                })), e = i.converter._dispatch("hashHTMLSpans.after", e, t, i)
            })), i.subParser("unhashHTMLSpans", (function (e, t, i) {
                e = i.converter._dispatch("unhashHTMLSpans.before", e, t, i);
                for (var n = 0; n < i.gHtmlSpans.length; ++n) {
                    for (var o = i.gHtmlSpans[n], r = 0; /¨C(\d+)C/.test(o);) {
                        var a = RegExp.$1;
                        if (o = o.replace("¨C" + a + "C", i.gHtmlSpans[a]), 10 === r) {
                            console.error("maximum nesting of 10 spans reached!!!");
                            break
                        }
                        ++r
                    }
                    e = e.replace("¨C" + n + "C", o)
                }
                return e = i.converter._dispatch("unhashHTMLSpans.after", e, t, i)
            })), i.subParser("hashPreCodeTags", (function (e, t, n) {
                e = n.converter._dispatch("hashPreCodeTags.before", e, t, n);
                return e = i.helper.replaceRecursiveRegExp(e, (function (e, o, r, a) {
                    var s = r + i.subParser("encodeCode")(o, t, n) + a;
                    return "\n\n¨G" + (n.ghCodeBlocks.push({text: e, codeblock: s}) - 1) + "G\n\n"
                }), "^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>", "^ {0,3}</code>\\s*</pre>", "gim"), e = n.converter._dispatch("hashPreCodeTags.after", e, t, n)
            })), i.subParser("headers", (function (e, t, n) {
                e = n.converter._dispatch("headers.before", e, t, n);
                var o = isNaN(parseInt(t.headerLevelStart)) ? 1 : parseInt(t.headerLevelStart),
                    r = t.smoothLivePreview ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm,
                    a = t.smoothLivePreview ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm;
                e = (e = e.replace(r, (function (e, r) {
                    var a = i.subParser("spanGamut")(r, t, n), s = t.noHeaderId ? "" : ' id="' + c(r) + '"',
                        l = "<h" + o + s + ">" + a + "</h" + o + ">";
                    return i.subParser("hashBlock")(l, t, n)
                }))).replace(a, (function (e, r) {
                    var a = i.subParser("spanGamut")(r, t, n), s = t.noHeaderId ? "" : ' id="' + c(r) + '"', l = o + 1,
                        d = "<h" + l + s + ">" + a + "</h" + l + ">";
                    return i.subParser("hashBlock")(d, t, n)
                }));
                var s = t.requireSpaceBeforeHeadingText ? /^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm : /^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;

                function c(e) {
                    var o, r;
                    if (t.customizedHeaderId) {
                        var a = e.match(/\{([^{]+?)}\s*$/);
                        a && a[1] && (e = a[1])
                    }
                    return o = e, r = i.helper.isString(t.prefixHeaderId) ? t.prefixHeaderId : !0 === t.prefixHeaderId ? "section-" : "", t.rawPrefixHeaderId || (o = r + o), o = t.ghCompatibleHeaderId ? o.replace(/ /g, "-").replace(/&amp;/g, "").replace(/¨T/g, "").replace(/¨D/g, "").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g, "").toLowerCase() : t.rawHeaderId ? o.replace(/ /g, "-").replace(/&amp;/g, "&").replace(/¨T/g, "¨").replace(/¨D/g, "$").replace(/["']/g, "-").toLowerCase() : o.replace(/[^\w]/g, "").toLowerCase(), t.rawPrefixHeaderId && (o = r + o), n.hashLinkCounts[o] ? o = o + "-" + n.hashLinkCounts[o]++ : n.hashLinkCounts[o] = 1, o
                }

                return e = e.replace(s, (function (e, r, a) {
                    var s = a;
                    t.customizedHeaderId && (s = a.replace(/\s?\{([^{]+?)}\s*$/, ""));
                    var l = i.subParser("spanGamut")(s, t, n), d = t.noHeaderId ? "" : ' id="' + c(a) + '"',
                        u = o - 1 + r.length, h = "<h" + u + d + ">" + l + "</h" + u + ">";
                    return i.subParser("hashBlock")(h, t, n)
                })), e = n.converter._dispatch("headers.after", e, t, n)
            })), i.subParser("horizontalRule", (function (e, t, n) {
                e = n.converter._dispatch("horizontalRule.before", e, t, n);
                var o = i.subParser("hashBlock")("<hr />", t, n);
                return e = (e = (e = e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, o)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, o)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, o), e = n.converter._dispatch("horizontalRule.after", e, t, n)
            })), i.subParser("images", (function (e, t, n) {
                function o(e, t, o, r, a, s, c, l) {
                    var d = n.gUrls, u = n.gTitles, h = n.gDimensions;
                    if (o = o.toLowerCase(), l || (l = ""), e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) r = ""; else if ("" === r || null === r) {
                        if ("" !== o && null !== o || (o = t.toLowerCase().replace(/ ?\n/g, " ")), r = "#" + o, i.helper.isUndefined(d[o])) return e;
                        r = d[o], i.helper.isUndefined(u[o]) || (l = u[o]), i.helper.isUndefined(h[o]) || (a = h[o].width, s = h[o].height)
                    }
                    t = t.replace(/"/g, "&quot;").replace(i.helper.regexes.asteriskDashAndColon, i.helper.escapeCharactersCallback);
                    var p = '<img src="' + (r = r.replace(i.helper.regexes.asteriskDashAndColon, i.helper.escapeCharactersCallback)) + '" alt="' + t + '"';
                    return l && i.helper.isString(l) && (p += ' title="' + (l = l.replace(/"/g, "&quot;").replace(i.helper.regexes.asteriskDashAndColon, i.helper.escapeCharactersCallback)) + '"'), a && s && (p += ' width="' + (a = "*" === a ? "auto" : a) + '"', p += ' height="' + (s = "*" === s ? "auto" : s) + '"'), p += " />"
                }

                return e = (e = (e = (e = (e = (e = n.converter._dispatch("images.before", e, t, n)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g, o)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g, (function (e, t, i, n, r, a, s, c) {
                    return o(e, t, i, n = n.replace(/\s/g, ""), r, a, s, c)
                }))).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g, o)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g, o)).replace(/!\[([^\[\]]+)]()()()()()/g, o), e = n.converter._dispatch("images.after", e, t, n)
            })), i.subParser("italicsAndBold", (function (e, t, i) {
                function n(e, t, i) {
                    return t + e + i
                }

                return e = i.converter._dispatch("italicsAndBold.before", e, t, i), e = t.literalMidWordUnderscores ? (e = (e = e.replace(/\b___(\S[\s\S]*?)___\b/g, (function (e, t) {
                    return n(t, "<strong><em>", "</em></strong>")
                }))).replace(/\b__(\S[\s\S]*?)__\b/g, (function (e, t) {
                    return n(t, "<strong>", "</strong>")
                }))).replace(/\b_(\S[\s\S]*?)_\b/g, (function (e, t) {
                    return n(t, "<em>", "</em>")
                })) : (e = (e = e.replace(/___(\S[\s\S]*?)___/g, (function (e, t) {
                    return /\S$/.test(t) ? n(t, "<strong><em>", "</em></strong>") : e
                }))).replace(/__(\S[\s\S]*?)__/g, (function (e, t) {
                    return /\S$/.test(t) ? n(t, "<strong>", "</strong>") : e
                }))).replace(/_([^\s_][\s\S]*?)_/g, (function (e, t) {
                    return /\S$/.test(t) ? n(t, "<em>", "</em>") : e
                })), e = t.literalMidWordAsterisks ? (e = (e = e.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g, (function (e, t, i) {
                    return n(i, t + "<strong><em>", "</em></strong>")
                }))).replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g, (function (e, t, i) {
                    return n(i, t + "<strong>", "</strong>")
                }))).replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g, (function (e, t, i) {
                    return n(i, t + "<em>", "</em>")
                })) : (e = (e = e.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g, (function (e, t) {
                    return /\S$/.test(t) ? n(t, "<strong><em>", "</em></strong>") : e
                }))).replace(/\*\*(\S[\s\S]*?)\*\*/g, (function (e, t) {
                    return /\S$/.test(t) ? n(t, "<strong>", "</strong>") : e
                }))).replace(/\*([^\s*][\s\S]*?)\*/g, (function (e, t) {
                    return /\S$/.test(t) ? n(t, "<em>", "</em>") : e
                })), e = i.converter._dispatch("italicsAndBold.after", e, t, i)
            })), i.subParser("lists", (function (e, t, n) {
                function o(e, o) {
                    n.gListLevel++, e = e.replace(/\n{2,}$/, "\n");
                    var r = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,
                        a = /\n[ \t]*\n(?!¨0)/.test(e += "¨0");
                    return t.disableForced4SpacesIndentedSublists && (r = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm), e = (e = e.replace(r, (function (e, o, r, s, c, l, d) {
                        d = d && "" !== d.trim();
                        var u = i.subParser("outdent")(c, t, n), h = "";
                        return l && t.tasklists && (h = ' class="task-list-item" style="list-style-type: none;"', u = u.replace(/^[ \t]*\[(x|X| )?]/m, (function () {
                            var e = '<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';
                            return d && (e += " checked"), e += ">"
                        }))), u = u.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g, (function (e) {
                            return "¨A" + e
                        })), o || u.search(/\n{2,}/) > -1 ? (u = i.subParser("githubCodeBlocks")(u, t, n), u = i.subParser("blockGamut")(u, t, n)) : (u = (u = i.subParser("lists")(u, t, n)).replace(/\n$/, ""), u = (u = i.subParser("hashHTMLBlocks")(u, t, n)).replace(/\n\n+/g, "\n\n"), u = a ? i.subParser("paragraphs")(u, t, n) : i.subParser("spanGamut")(u, t, n)), u = "<li" + h + ">" + (u = u.replace("¨A", "")) + "</li>\n"
                    }))).replace(/¨0/g, ""), n.gListLevel--, o && (e = e.replace(/\s+$/, "")), e
                }

                function r(e, t) {
                    if ("ol" === t) {
                        var i = e.match(/^ *(\d+)\./);
                        if (i && "1" !== i[1]) return ' start="' + i[1] + '"'
                    }
                    return ""
                }

                function a(e, i, n) {
                    var a = t.disableForced4SpacesIndentedSublists ? /^ ?\d+\.[ \t]/gm : /^ {0,3}\d+\.[ \t]/gm,
                        s = t.disableForced4SpacesIndentedSublists ? /^ ?[*+-][ \t]/gm : /^ {0,3}[*+-][ \t]/gm,
                        c = "ul" === i ? a : s, l = "";
                    if (-1 !== e.search(c)) !function t(d) {
                        var u = d.search(c), h = r(e, i);
                        -1 !== u ? (l += "\n\n<" + i + h + ">\n" + o(d.slice(0, u), !!n) + "</" + i + ">\n", c = "ul" === (i = "ul" === i ? "ol" : "ul") ? a : s, t(d.slice(u))) : l += "\n\n<" + i + h + ">\n" + o(d, !!n) + "</" + i + ">\n"
                    }(e); else {
                        var d = r(e, i);
                        l = "\n\n<" + i + d + ">\n" + o(e, !!n) + "</" + i + ">\n"
                    }
                    return l
                }

                return e = n.converter._dispatch("lists.before", e, t, n), e += "¨0", e = (e = n.gListLevel ? e.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm, (function (e, t, i) {
                    return a(t, i.search(/[*+-]/g) > -1 ? "ul" : "ol", !0)
                })) : e.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm, (function (e, t, i, n) {
                    return a(i, n.search(/[*+-]/g) > -1 ? "ul" : "ol", !1)
                }))).replace(/¨0/, ""), e = n.converter._dispatch("lists.after", e, t, n)
            })), i.subParser("metadata", (function (e, t, i) {
                if (!t.metadata) return e;

                function n(e) {
                    i.metadata.raw = e, (e = (e = e.replace(/&/g, "&amp;").replace(/"/g, "&quot;")).replace(/\n {4}/g, " ")).replace(/^([\S ]+): +([\s\S]+?)$/gm, (function (e, t, n) {
                        return i.metadata.parsed[t] = n, ""
                    }))
                }

                return e = (e = (e = (e = i.converter._dispatch("metadata.before", e, t, i)).replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/, (function (e, t, i) {
                    return n(i), "¨M"
                }))).replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/, (function (e, t, o) {
                    return t && (i.metadata.format = t), n(o), "¨M"
                }))).replace(/¨M/g, ""), e = i.converter._dispatch("metadata.after", e, t, i)
            })), i.subParser("outdent", (function (e, t, i) {
                return e = (e = (e = i.converter._dispatch("outdent.before", e, t, i)).replace(/^(\t|[ ]{1,4})/gm, "¨0")).replace(/¨0/g, ""), e = i.converter._dispatch("outdent.after", e, t, i)
            })), i.subParser("paragraphs", (function (e, t, n) {
                for (var o = (e = (e = (e = n.converter._dispatch("paragraphs.before", e, t, n)).replace(/^\n+/g, "")).replace(/\n+$/g, "")).split(/\n{2,}/g), r = [], a = o.length, s = 0; s < a; s++) {
                    var c = o[s];
                    c.search(/¨(K|G)(\d+)\1/g) >= 0 ? r.push(c) : c.search(/\S/) >= 0 && (c = (c = i.subParser("spanGamut")(c, t, n)).replace(/^([ \t]*)/g, "<p>"), c += "</p>", r.push(c))
                }
                for (a = r.length, s = 0; s < a; s++) {
                    for (var l = "", d = r[s], u = !1; /¨(K|G)(\d+)\1/.test(d);) {
                        var h = RegExp.$1, p = RegExp.$2;
                        l = (l = "K" === h ? n.gHtmlBlocks[p] : u ? i.subParser("encodeCode")(n.ghCodeBlocks[p].text, t, n) : n.ghCodeBlocks[p].codeblock).replace(/\$/g, "$$$$"), d = d.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/, l), /^<pre\b[^>]*>\s*<code\b[^>]*>/.test(d) && (u = !0)
                    }
                    r[s] = d
                }
                return e = (e = (e = r.join("\n")).replace(/^\n+/g, "")).replace(/\n+$/g, ""), n.converter._dispatch("paragraphs.after", e, t, n)
            })), i.subParser("runExtension", (function (e, t, i, n) {
                if (e.filter) t = e.filter(t, n.converter, i); else if (e.regex) {
                    var o = e.regex;
                    o instanceof RegExp || (o = new RegExp(o, "g")), t = t.replace(o, e.replace)
                }
                return t
            })), i.subParser("spanGamut", (function (e, t, n) {
                return e = n.converter._dispatch("spanGamut.before", e, t, n), e = i.subParser("codeSpans")(e, t, n), e = i.subParser("escapeSpecialCharsWithinTagAttributes")(e, t, n), e = i.subParser("encodeBackslashEscapes")(e, t, n), e = i.subParser("images")(e, t, n), e = i.subParser("anchors")(e, t, n), e = i.subParser("autoLinks")(e, t, n), e = i.subParser("simplifiedAutoLinks")(e, t, n), e = i.subParser("emoji")(e, t, n), e = i.subParser("underline")(e, t, n), e = i.subParser("italicsAndBold")(e, t, n), e = i.subParser("strikethrough")(e, t, n), e = i.subParser("ellipsis")(e, t, n), e = i.subParser("hashHTMLSpans")(e, t, n), e = i.subParser("encodeAmpsAndAngles")(e, t, n), t.simpleLineBreaks ? /\n\n¨K/.test(e) || (e = e.replace(/\n+/g, "<br />\n")) : e = e.replace(/  +\n/g, "<br />\n"), e = n.converter._dispatch("spanGamut.after", e, t, n)
            })), i.subParser("strikethrough", (function (e, t, n) {
                return t.strikethrough && (e = (e = n.converter._dispatch("strikethrough.before", e, t, n)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g, (function (e, o) {
                    return function (e) {
                        return t.simplifiedAutoLink && (e = i.subParser("simplifiedAutoLinks")(e, t, n)), "<del>" + e + "</del>"
                    }(o)
                })), e = n.converter._dispatch("strikethrough.after", e, t, n)), e
            })), i.subParser("stripLinkDefinitions", (function (e, t, n) {
                var o = function (e, o, r, a, s, c, l) {
                    return o = o.toLowerCase(), r.match(/^data:.+?\/.+?;base64,/) ? n.gUrls[o] = r.replace(/\s/g, "") : n.gUrls[o] = i.subParser("encodeAmpsAndAngles")(r, t, n), c ? c + l : (l && (n.gTitles[o] = l.replace(/"|'/g, "&quot;")), t.parseImgDimensions && a && s && (n.gDimensions[o] = {
                        width: a,
                        height: s
                    }), "")
                };
                return e = (e = (e = (e += "¨0").replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm, o)).replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm, o)).replace(/¨0/, "")
            })), i.subParser("tables", (function (e, t, n) {
                if (!t.tables) return e;

                function o(e, o) {
                    return "<td" + o + ">" + i.subParser("spanGamut")(e, t, n) + "</td>\n"
                }

                function r(e) {
                    var r, a = e.split("\n");
                    for (r = 0; r < a.length; ++r) /^ {0,3}\|/.test(a[r]) && (a[r] = a[r].replace(/^ {0,3}\|/, "")), /\|[ \t]*$/.test(a[r]) && (a[r] = a[r].replace(/\|[ \t]*$/, "")), a[r] = i.subParser("codeSpans")(a[r], t, n);
                    var s, c, l, d, u = a[0].split("|").map((function (e) {
                        return e.trim()
                    })), h = a[1].split("|").map((function (e) {
                        return e.trim()
                    })), p = [], m = [], f = [], g = [];
                    for (a.shift(), a.shift(), r = 0; r < a.length; ++r) "" !== a[r].trim() && p.push(a[r].split("|").map((function (e) {
                        return e.trim()
                    })));
                    if (u.length < h.length) return e;
                    for (r = 0; r < h.length; ++r) f.push((s = h[r], /^:[ \t]*--*$/.test(s) ? ' style="text-align:left;"' : /^--*[ \t]*:[ \t]*$/.test(s) ? ' style="text-align:right;"' : /^:[ \t]*--*[ \t]*:$/.test(s) ? ' style="text-align:center;"' : ""));
                    for (r = 0; r < u.length; ++r) i.helper.isUndefined(f[r]) && (f[r] = ""), m.push((c = u[r], l = f[r], d = void 0, d = "", c = c.trim(), (t.tablesHeaderId || t.tableHeaderId) && (d = ' id="' + c.replace(/ /g, "_").toLowerCase() + '"'), "<th" + d + l + ">" + (c = i.subParser("spanGamut")(c, t, n)) + "</th>\n"));
                    for (r = 0; r < p.length; ++r) {
                        for (var b = [], v = 0; v < m.length; ++v) i.helper.isUndefined(p[r][v]), b.push(o(p[r][v], f[v]));
                        g.push(b)
                    }
                    return function (e, t) {
                        for (var i = "<table>\n<thead>\n<tr>\n", n = e.length, o = 0; o < n; ++o) i += e[o];
                        for (i += "</tr>\n</thead>\n<tbody>\n", o = 0; o < t.length; ++o) {
                            i += "<tr>\n";
                            for (var r = 0; r < n; ++r) i += t[o][r];
                            i += "</tr>\n"
                        }
                        return i += "</tbody>\n</table>\n"
                    }(m, g)
                }

                return e = (e = (e = (e = n.converter._dispatch("tables.before", e, t, n)).replace(/\\(\|)/g, i.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm, r)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm, r), e = n.converter._dispatch("tables.after", e, t, n)
            })), i.subParser("underline", (function (e, t, n) {
                return t.underline ? (e = n.converter._dispatch("underline.before", e, t, n), e = (e = t.literalMidWordUnderscores ? (e = e.replace(/\b___(\S[\s\S]*?)___\b/g, (function (e, t) {
                    return "<u>" + t + "</u>"
                }))).replace(/\b__(\S[\s\S]*?)__\b/g, (function (e, t) {
                    return "<u>" + t + "</u>"
                })) : (e = e.replace(/___(\S[\s\S]*?)___/g, (function (e, t) {
                    return /\S$/.test(t) ? "<u>" + t + "</u>" : e
                }))).replace(/__(\S[\s\S]*?)__/g, (function (e, t) {
                    return /\S$/.test(t) ? "<u>" + t + "</u>" : e
                }))).replace(/(_)/g, i.helper.escapeCharactersCallback), e = n.converter._dispatch("underline.after", e, t, n)) : e
            })), i.subParser("unescapeSpecialChars", (function (e, t, i) {
                return e = (e = i.converter._dispatch("unescapeSpecialChars.before", e, t, i)).replace(/¨E(\d+)E/g, (function (e, t) {
                    var i = parseInt(t);
                    return String.fromCharCode(i)
                })), e = i.converter._dispatch("unescapeSpecialChars.after", e, t, i)
            })), i.subParser("makeMarkdown.blockquote", (function (e, t) {
                var n = "";
                if (e.hasChildNodes()) for (var o = e.childNodes, r = o.length, a = 0; a < r; ++a) {
                    var s = i.subParser("makeMarkdown.node")(o[a], t);
                    "" !== s && (n += s)
                }
                return n = "> " + (n = n.trim()).split("\n").join("\n> ")
            })), i.subParser("makeMarkdown.codeBlock", (function (e, t) {
                var i = e.getAttribute("language"), n = e.getAttribute("precodenum");
                return "```" + i + "\n" + t.preList[n] + "\n```"
            })), i.subParser("makeMarkdown.codeSpan", (function (e) {
                return "`" + e.innerHTML + "`"
            })), i.subParser("makeMarkdown.emphasis", (function (e, t) {
                var n = "";
                if (e.hasChildNodes()) {
                    n += "*";
                    for (var o = e.childNodes, r = o.length, a = 0; a < r; ++a) n += i.subParser("makeMarkdown.node")(o[a], t);
                    n += "*"
                }
                return n
            })), i.subParser("makeMarkdown.header", (function (e, t, n) {
                var o = new Array(n + 1).join("#"), r = "";
                if (e.hasChildNodes()) {
                    r = o + " ";
                    for (var a = e.childNodes, s = a.length, c = 0; c < s; ++c) r += i.subParser("makeMarkdown.node")(a[c], t)
                }
                return r
            })), i.subParser("makeMarkdown.hr", (function () {
                return "---"
            })), i.subParser("makeMarkdown.image", (function (e) {
                var t = "";
                return e.hasAttribute("src") && (t += "![" + e.getAttribute("alt") + "](", t += "<" + e.getAttribute("src") + ">", e.hasAttribute("width") && e.hasAttribute("height") && (t += " =" + e.getAttribute("width") + "x" + e.getAttribute("height")), e.hasAttribute("title") && (t += ' "' + e.getAttribute("title") + '"'), t += ")"), t
            })), i.subParser("makeMarkdown.links", (function (e, t) {
                var n = "";
                if (e.hasChildNodes() && e.hasAttribute("href")) {
                    var o = e.childNodes, r = o.length;
                    n = "[";
                    for (var a = 0; a < r; ++a) n += i.subParser("makeMarkdown.node")(o[a], t);
                    n += "](", n += "<" + e.getAttribute("href") + ">", e.hasAttribute("title") && (n += ' "' + e.getAttribute("title") + '"'), n += ")"
                }
                return n
            })), i.subParser("makeMarkdown.list", (function (e, t, n) {
                var o = "";
                if (!e.hasChildNodes()) return "";
                for (var r = e.childNodes, a = r.length, s = e.getAttribute("start") || 1, c = 0; c < a; ++c) if (void 0 !== r[c].tagName && "li" === r[c].tagName.toLowerCase()) {
                    o += ("ol" === n ? s.toString() + ". " : "- ") + i.subParser("makeMarkdown.listItem")(r[c], t), ++s
                }
                return (o += "\n\x3c!-- --\x3e\n").trim()
            })), i.subParser("makeMarkdown.listItem", (function (e, t) {
                for (var n = "", o = e.childNodes, r = o.length, a = 0; a < r; ++a) n += i.subParser("makeMarkdown.node")(o[a], t);
                return /\n$/.test(n) ? n = n.split("\n").join("\n    ").replace(/^ {4}$/gm, "").replace(/\n\n+/g, "\n\n") : n += "\n", n
            })), i.subParser("makeMarkdown.node", (function (e, t, n) {
                n = n || !1;
                var o = "";
                if (3 === e.nodeType) return i.subParser("makeMarkdown.txt")(e, t);
                if (8 === e.nodeType) return "\x3c!--" + e.data + "--\x3e\n\n";
                if (1 !== e.nodeType) return "";
                switch (e.tagName.toLowerCase()) {
                    case"h1":
                        n || (o = i.subParser("makeMarkdown.header")(e, t, 1) + "\n\n");
                        break;
                    case"h2":
                        n || (o = i.subParser("makeMarkdown.header")(e, t, 2) + "\n\n");
                        break;
                    case"h3":
                        n || (o = i.subParser("makeMarkdown.header")(e, t, 3) + "\n\n");
                        break;
                    case"h4":
                        n || (o = i.subParser("makeMarkdown.header")(e, t, 4) + "\n\n");
                        break;
                    case"h5":
                        n || (o = i.subParser("makeMarkdown.header")(e, t, 5) + "\n\n");
                        break;
                    case"h6":
                        n || (o = i.subParser("makeMarkdown.header")(e, t, 6) + "\n\n");
                        break;
                    case"p":
                        n || (o = i.subParser("makeMarkdown.paragraph")(e, t) + "\n\n");
                        break;
                    case"blockquote":
                        n || (o = i.subParser("makeMarkdown.blockquote")(e, t) + "\n\n");
                        break;
                    case"hr":
                        n || (o = i.subParser("makeMarkdown.hr")(e, t) + "\n\n");
                        break;
                    case"ol":
                        n || (o = i.subParser("makeMarkdown.list")(e, t, "ol") + "\n\n");
                        break;
                    case"ul":
                        n || (o = i.subParser("makeMarkdown.list")(e, t, "ul") + "\n\n");
                        break;
                    case"precode":
                        n || (o = i.subParser("makeMarkdown.codeBlock")(e, t) + "\n\n");
                        break;
                    case"pre":
                        n || (o = i.subParser("makeMarkdown.pre")(e, t) + "\n\n");
                        break;
                    case"table":
                        n || (o = i.subParser("makeMarkdown.table")(e, t) + "\n\n");
                        break;
                    case"code":
                        o = i.subParser("makeMarkdown.codeSpan")(e, t);
                        break;
                    case"em":
                    case"i":
                        o = i.subParser("makeMarkdown.emphasis")(e, t);
                        break;
                    case"strong":
                    case"b":
                        o = i.subParser("makeMarkdown.strong")(e, t);
                        break;
                    case"del":
                        o = i.subParser("makeMarkdown.strikethrough")(e, t);
                        break;
                    case"a":
                        o = i.subParser("makeMarkdown.links")(e, t);
                        break;
                    case"img":
                        o = i.subParser("makeMarkdown.image")(e, t);
                        break;
                    default:
                        o = e.outerHTML + "\n\n"
                }
                return o
            })), i.subParser("makeMarkdown.paragraph", (function (e, t) {
                var n = "";
                if (e.hasChildNodes()) for (var o = e.childNodes, r = o.length, a = 0; a < r; ++a) n += i.subParser("makeMarkdown.node")(o[a], t);
                return n = n.trim()
            })), i.subParser("makeMarkdown.pre", (function (e, t) {
                var i = e.getAttribute("prenum");
                return "<pre>" + t.preList[i] + "</pre>"
            })), i.subParser("makeMarkdown.strikethrough", (function (e, t) {
                var n = "";
                if (e.hasChildNodes()) {
                    n += "~~";
                    for (var o = e.childNodes, r = o.length, a = 0; a < r; ++a) n += i.subParser("makeMarkdown.node")(o[a], t);
                    n += "~~"
                }
                return n
            })), i.subParser("makeMarkdown.strong", (function (e, t) {
                var n = "";
                if (e.hasChildNodes()) {
                    n += "**";
                    for (var o = e.childNodes, r = o.length, a = 0; a < r; ++a) n += i.subParser("makeMarkdown.node")(o[a], t);
                    n += "**"
                }
                return n
            })), i.subParser("makeMarkdown.table", (function (e, t) {
                var n, o, r = "", a = [[], []], s = e.querySelectorAll("thead>tr>th"),
                    c = e.querySelectorAll("tbody>tr");
                for (n = 0; n < s.length; ++n) {
                    var l = i.subParser("makeMarkdown.tableCell")(s[n], t), d = "---";
                    if (s[n].hasAttribute("style")) switch (s[n].getAttribute("style").toLowerCase().replace(/\s/g, "")) {
                        case"text-align:left;":
                            d = ":---";
                            break;
                        case"text-align:right;":
                            d = "---:";
                            break;
                        case"text-align:center;":
                            d = ":---:"
                    }
                    a[0][n] = l.trim(), a[1][n] = d
                }
                for (n = 0; n < c.length; ++n) {
                    var u = a.push([]) - 1, h = c[n].getElementsByTagName("td");
                    for (o = 0; o < s.length; ++o) {
                        var p = " ";
                        void 0 !== h[o] && (p = i.subParser("makeMarkdown.tableCell")(h[o], t)), a[u].push(p)
                    }
                }
                var m = 3;
                for (n = 0; n < a.length; ++n) for (o = 0; o < a[n].length; ++o) {
                    var f = a[n][o].length;
                    f > m && (m = f)
                }
                for (n = 0; n < a.length; ++n) {
                    for (o = 0; o < a[n].length; ++o) 1 === n ? ":" === a[n][o].slice(-1) ? a[n][o] = i.helper.padEnd(a[n][o].slice(-1), m - 1, "-") + ":" : a[n][o] = i.helper.padEnd(a[n][o], m, "-") : a[n][o] = i.helper.padEnd(a[n][o], m);
                    r += "| " + a[n].join(" | ") + " |\n"
                }
                return r.trim()
            })), i.subParser("makeMarkdown.tableCell", (function (e, t) {
                var n = "";
                if (!e.hasChildNodes()) return "";
                for (var o = e.childNodes, r = o.length, a = 0; a < r; ++a) n += i.subParser("makeMarkdown.node")(o[a], t, !0);
                return n.trim()
            })), i.subParser("makeMarkdown.txt", (function (e) {
                var t = e.nodeValue;
                return t = (t = t.replace(/ +/g, " ")).replace(/¨NBSP;/g, " "), t = (t = (t = (t = (t = (t = (t = (t = (t = i.helper.unescapeHTMLEntities(t)).replace(/([*_~|`])/g, "\\$1")).replace(/^(\s*)>/g, "\\$1>")).replace(/^#/gm, "\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/, "$1\\$2$3")).replace(/^( {0,3}\d+)\./gm, "$1\\.")).replace(/^( {0,3})([+-])/gm, "$1\\$2")).replace(/]([\s]*)\(/g, "\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm, "\\[$1]:")
            }));
            e.exports ? e.exports = i : this.showdown = i
        }).call(yn)
    }));
    kn.setFlavor("github"), wn.addHook("afterSanitizeAttributes", (function (e) {
        "target" in e && e.setAttribute("target", "_blank"), e.hasAttribute("target") || !e.hasAttribute("xlink:href") && !e.hasAttribute("href") || e.setAttribute("xlink:show", "new")
    }));
    const Sn = new kn.Converter, Cn = document.createElement("div");
    window.customElements.define("ion-button", class extends ie {
        static get styles() {
            return [ee`:host{display:inline-block;box-sizing:border-box;user-select:none}:host(:focus){outline:0}.btn{font-family:var(--font-family);font-size:var(--font-size);font-weight:400;display:inline-block;text-align:center;white-space:nowrap;vertical-align:middle;border:1px solid transparent;padding:var(--button-padding,.4rem 1rem);user-select:none;line-height:1.35;border-radius:var(--border-radius);cursor:pointer}.btn:focus{outline:0}.btn>*{pointer-events:none}:host(.btn-small) .btn{font-size:var(--font-size-small);padding:.2rem .4rem}::slotted(svg){height:.8rem;width:.8rem;vertical-align:middle;margin-right:.3rem;margin-top:-.2rem}.btn-primary{color:var(--text-light);fill:var(--text-light);background-color:var(--brand-primary);border-color:var(--brand-primary-shade)}.btn-primary:hover{background-color:var(--brand-primary-shade)}.btn-primary:active{background-color:var(--brand-primary-dark)}.btn-dark{color:var(--text-light);fill:var(--text-light);background-color:var(--brand-dark);border-color:var(--brand-dark-shade)}.btn-dark:hover{background-color:var(--brand-primary);border-color:var(--brand-primary-shade)}.btn-dark:active{background-color:var(--brand-primary-shade)}.btn-default{fill:var(--text-color);color:var(--text-color);background-color:var(--container-bg);border-color:var(--border-color)}.btn-default:hover{background-color:var(--brand-primary-tint)}.btn-default:active{background-color:var(--gray-lighter)}:host([disabled]) .btn{background-color:var(--gray-light);color:var(--text-muted);border-color:transparent;cursor:default}:host([disabled]) .btn:active{border-color:transparent}`]
        }

        static get properties() {
            return {theme: {type: String}, disabled: {type: Boolean, reflect: !0}}
        }

        constructor() {
            super(), this.theme = "default", this.disabled = !1
        }

        render() {
            return z`<button class="btn btn-${this.theme}" type="button" ?disabled="${this.disabled}"><slot></slot></button>`
        }
    });
    var En = ee`:host{display:block;box-sizing:border-box;font-size:var(--font-size)}:host(:focus){outline:0}:host([hidden]),[hidden]{display:none}label{color:var(--text-color);font-size:var(--font-size-large)}:host([required]) label::after{color:var(--text-muted);font-size:var(--font-size-small);content:" (required)"}.ion-form-input{width:100%;height:2.5rem;line-height:1.5;color:var(--text-color);background-color:var(--container-bg);border:1px solid var(--border-color);border-radius:var(--border-radius);font-family:var(--font-family);margin-top:.2rem;font-size:inherit;display:block;box-sizing:border-box}.ion-form-input:invalid{border-color:var(--border-color);box-shadow:none}.ion-form-input.invalid{border-color:var(--brand-danger);box-shadow:0 0 3px 0 var(--brand-danger)}input.ion-form-input{padding:0 1rem}textarea.ion-form-input{padding:.5rem 1rem}.ion-form-input:active,.ion-form-input:focus{border-color:var(--brand-primary-tint);outline:0;box-shadow:0 0 .25rem rgba(45,135,196,.4)}textarea{border-radius:15px;resize:vertical}:host([disabled]){pointer-events:none}:host([disabled]) .ion-form-input{background-color:var(--gray-light);color:var(--text-muted)}`;

    function Tn(e) {
        return /^\s*$/g.test(e)
    }

    window.customElements.define("ion-select", class extends ie {
        static get styles() {
            return [En, ee`select{cursor:pointer}.ion-form-input{padding:.63rem 1rem;width:100%}`]
        }

        static get properties() {
            return {label: {type: String}, value: {type: Object}, values: {type: Array}}
        }

        constructor() {
            super(), this.label = "", this._value = void 0, this._values = [], this._elementId = `ion-${e.createGuid()}`
        }

        get value() {
            return this._value
        }

        set value(e) {
            this._value = e, this.requestUpdate()
        }

        get values() {
            return this._values
        }

        set values(e) {
            this._values = e, this.requestUpdate()
        }

        render() {
            return z`${"" !== this.label ? z`<label for="${this._elementId}">${this.label}</label>` : ""} <select class="ion-form-input" @change="${this._valueChange}">${this._values.map(e => z`<option ?disabled="${e.disabled}" value="${e.id}">${e.name}</option>`)}</select>`
        }

        updated() {
            this._setSelectValue()
        }

        _valueChange(e) {
            let t = e.target.selectedIndex;
            t < 0 || (this._value = this._values[t].id, this.dispatchEvent(new CustomEvent("change")))
        }

        _setSelectValue() {
            const t = this.shadowRoot.querySelector("select");
            if (!e.defined(this._value)) return this._value = this.values[0].id, void (t.selectedIndex = 0);
            const i = this.values.findIndex(e => e.id === this._value);
            t.selectedIndex = i
        }
    });
    window.customElements.define("ion-textfield", class extends ie {
        static get styles() {
            return [En]
        }

        static get properties() {
            return {
                label: {type: String},
                value: {type: String},
                readonly: {type: Boolean},
                required: {type: Boolean},
                disabled: {type: Boolean}
            }
        }

        constructor() {
            super(), this.label = "", this.readonly = !1, this.required = !1, this.disabled = !1, this._value = "", this._elementId = `ion-${e.createGuid()}`
        }

        get value() {
            const t = this.shadowRoot.querySelector(`#${this._elementId}`);
            return e.defined(t) && (this._value = t.value), this._value
        }

        set value(t) {
            this._value = t;
            const i = this.shadowRoot.querySelector(`#${this._elementId}`);
            e.defined(i) && (i.value = t), this.requestUpdate()
        }

        checkValidity() {
            const e = this.shadowRoot.querySelector(`#${this._elementId}`);
            return this.required & Tn(e.value) ? (e.classList.add("invalid"), !1) : (e.classList.remove("invalid"), !0)
        }

        clearValidation() {
            this.shadowRoot.querySelector(`#${this._elementId}`).classList.remove("invalid")
        }

        select() {
            const t = this.shadowRoot.querySelector(`#${this._elementId}`);
            e.defined(t) && select(t)
        }

        keyup() {
            this.dispatchEvent(new CustomEvent("keyup", {detail: {text: this.value}}))
        }

        render() {
            return z`${"" !== this.label ? z`<label for="${this._elementId}">${this.label}</label>` : ""} <input id="${this._elementId}" class="ion-form-input" type="text" .value="${this._value}" ?readonly="${this.readonly}" ?required="${this.required}" ?disabled="${this.disabled}" @focus="${this.clearValidation}" @keyup="${this.keyup}">`
        }
    });
    const Mn = [se.GLTF, se.TERRAIN];
    let Pn;

    class Dn extends (ne(dt)(ie)) {
        static get styles() {
            return [Ri, ee`.assets{display:flex;width:100%}#assetList{width:100%;cursor:pointer;border-color:var(--border-color);border-radius:var(--border-radius);color:var(--text-color);font-family:var(--font-family);font-size:var(--font-size);outline:0}.assets.has-description #assetList{width:calc(50% - 1rem);margin-right:1rem}#description{display:none;width:50%;background-color:var(--container-bg);border:1px solid var(--border-color);padding:0 1rem;border-radius:var(--border-radius);max-height:200px;overflow-y:auto}.assets.has-description #description{display:block}#sort-filter{width:100%;margin-bottom:1rem;justify-content:space-around}#sort-filter>*{display:inline-block;vertical-align:bottom;margin-right:1rem}#sort-filter>:last-child{margin-right:0}#sort-filter>ion-textfield{width:calc(50% - 1rem)}#sort-filter>ion-select{width:calc(25% - .5rem)}#upload a svg{height:.75rem}`]
        }

        static get properties() {
            return {
                _selectedId: {type: Number},
                _sortFunction: {type: Function},
                _filterType: {type: String},
                _filterText: {type: String}
            }
        }

        constructor() {
            super(), this._addedAssetIds = [], this._userAssets = [], this._selectedId = void 0, this._sortFunction = this._sortByName, this._filterType = void 0, this._filterText = "", this._polling = !1
        }

        connectedCallback() {
            super.connectedCallback(), this.pollAssets()
        }

        disconnectedCallback() {
            super.disconnectedCallback(), this._polling = !1
        }

        _schedulePoll(e) {
            this._polling && setTimeout(() => {
                this._polling && this.pollAssets()
            }, e)
        }

        async pollAssets() {
            let e;
            this._polling = !0;
            try {
                e = await ve()
            } catch (e) {
                return void this._schedulePoll(1e4)
            }
            this._polling && (this._userAssets = e.filter(e => !Mn.includes(e.type)), this.requestUpdate(), this._polling = this._userAssets.some(e => re.isPending(e.status)), this._schedulePoll(5e3))
        }

        render() {
            let t, i = this._userAssets.slice().sort(this._sortFunction);
            this._addedAssetIds.forEach(e => {
                const t = i.findIndex(t => t.id === e);
                -1 !== t && i.splice(t, 1)
            }), i = i.filter(t => t.status !== re.AWAITING_FILES && (!e.defined(this._filterType) || t.type === this._filterType) && (0 === this._filterText.length || t.name.toLowerCase().includes(this._filterText))), e.defined(this._selectedId) && (t = i.find(e => e.id === this._selectedId), e.defined(t) || (this._selectedId = void 0));
            const n = e.defined(t);
            let o = "";
            return n && (o = function (e, t) {
                let i = wn.sanitize(Sn.makeHtml(e));
                Cn.innerHTML = i;
                const n = Cn.querySelectorAll("a");
                for (let e = 0; e < n.length; e++) n[e].setAttribute("target", "_blank"), n[e].setAttribute("rel", "noopener");
                return i = Cn.innerHTML, t && (i = i.replace(/<p>/g, "<span>"), i = i.replace(/<\/p>/g, "</span>")), i
            }(t.description)), z`<h1>Select an asset</h1><div id="sort-filter"><ion-textfield @input="${this._changeFilter}" .label="${"Search"}"></ion-textfield><ion-select @change="${this._changeTypeFilter}" .label="${"Asset type"}" .values="${e.defined(Pn) ? Pn : (Pn = se.getTypes().filter(e => !Mn.includes(e)).map(e => ({
                id: e,
                name: se.toString(e)
            })), Pn.unshift({
                id: "ALL",
                name: "All"
            }), Pn)}"></ion-select><ion-select @change="${this._changeSort}" .label="${"Sort by"}" .values="${[{
                id: "name",
                name: "Name"
            }, {
                id: "date",
                name: "Date added"
            }]}"></ion-select></div><div class="assets${n ? " has-description" : ""}"><select size="10" id="assetList" @change="${this._selectAsset}">${i.map(e => {
                let t = e.name, i = !1;
                return e.status === re.IN_PROGRESS || e.status === re.NOT_STARTED ? t += ` (${e.percentComplete}%)` : re.isError(e.status) && (i = !0, t += " (Error)"), z`<option value="${e.id}" ?disabled="${i}" ?selected="${e.id === this._selectedId}" @dblclick="${this._addAsset}">${t}</option>`
            })}</select><div id="description">${"" !== o ? z`${Fi(o)}` : z`<p class="muted">No description provided</p>`}</div></div><div id="upload" class="margin-bottom"><a @click="${this._uploadAsset}">${di.node} Upload new asset</a></div><ion-button theme="primary" @click="${this._addAsset}" ?disabled="${!n}">Add</ion-button><ion-button theme="default" @click="${this._cancel}">Cancel</ion-button>`
        }

        _changeFilter(e) {
            this._filterText = e.target.value.toLowerCase()
        }

        _changeTypeFilter(e) {
            const t = e.target.value;
            this._filterType = "ALL" === t ? void 0 : t
        }

        _changeSort(e) {
            const t = e.target.value;
            "name" === t ? this._sortFunction = this._sortByName : "date" === t && (this._sortFunction = this._sortById)
        }

        _sortByName(e, t) {
            return e.name.localeCompare(t.name)
        }

        _sortById(e, t) {
            return e.id - t.id
        }

        _selectAsset(e) {
            this._selectedId = Number(e.target.value)
        }

        _uploadAsset() {
            dt.dispatch(le(Be))
        }

        async _addAsset() {
            const t = this._selectedId;
            if (e.defined(t)) {
                const e = this._userAssets.find(e => e.id === t);
                this.dispatchEvent(new CustomEvent("close", {bubbles: !0, composed: !0, detail: {asset: e}}))
            }
        }

        _cancel() {
            this.dispatchEvent(new CustomEvent("close", {bubbles: !0, composed: !0}))
        }

        stateChanged(e) {
            e.story.assets.ids !== this._addedAssetIds && (this._addedAssetIds = e.story.assets.ids, this.requestUpdate())
        }
    }

    window.customElements.define("ion-asset-selector", Dn);
    customElements.define("ion-loading-icon", class extends ie {
        static get styles() {
            return [Ri, ee`:host{visibility:hidden;position:static}:host([visible]){visibility:visible}:host([centered]){position:absolute;top:calc(50% - 3rem);left:calc(50% - 3rem)}:host([centered]) svg{width:6rem;height:6rem}svg{width:100%;height:100%;-webkit-animation:spin 1s steps(8) infinite;-moz-animation:spin 1s steps(8) infinite;animation:spin 1s steps(8) infinite}@-moz-keyframes spin{0%{-moz-transform:rotate(0)}100%{-moz-transform:rotate(360deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}`]
        }

        static get properties() {
            return {visible: {type: Boolean, reflect: !0}, centered: {type: Boolean, reflect: !0}}
        }

        constructor() {
            super(), this.visible = !0, this.centered = !1
        }

        render() {
            return z`<span>${li.node}</span>`
        }
    });
    var In = Object.freeze({LONGITUDE: "longitude", LATITUDE: "latitude", DISTANCE: "distance"}),
        An = ee`:host{display:inline-block;font-family:var(--widgets-font-family);color:var(--widgets-text-color)}:host([hidden]){display:none}input{padding:var(--widget-input-padding,.2rem .5rem);color:var(--widgets-text-color);background-color:var(--widgets-default-color);border:1px solid var(--widgets-border-color);border-radius:var(--widgets-border-radius);font-family:var(--widgets-font-family)}button{border-radius:50%;border:none;height:1.5rem;width:1.5rem;padding:.4rem;background:0 0;position:relative;bottom:0;color:var(--widgets-text-color);cursor:pointer;vertical-align:middle}button:hover{background:var(--widgets-default-color)}button.active{color:var(--widgets-active-color)}button:focus{outline:0;background:var(--widgets-default-color)}button:active{background:var(--widgets-lighter-color)}`;
    const Ln = document.createElement("custom-style");
    Ln.innerHTML = '\n  <style is="custom-style">\n    html {\n        --widgets-font-family: sans-serif;\n        --widgets-text-color: #edffff;\n        --widgets-border-color: #444;\n        --widgets-text-color-secondary: #888;\n        --widgets-background-color: #222;\n        --widgets-transparent-background-color: #222D;\n        --widgets-darker-color: #111;\n        --widgets-default-color: #444;\n        --widgets-lighter-color: #555;\n        --widgets-container-border-radius: 4px;\n        --mediumGrey: #888;\n        --alpha-backdrop-light: #c8c8c8;\n        --alpha-backdrop-dark: #b4b4b4;\n        --widgets-active-color: #48b;\n        --widgets-active-color-shade: #1e3344;\n        --widgets-border-radius: 4px;\n        --widgets-transition-time: 0.2s;\n        --shadow-color: #00000099;\n\n        --focus-color: #FFA726;\n        --focus-width: 2px;\n    }\n\n  </style>\n', document.head.appendChild(Ln);
    const Nn = new e.Ray, zn = new e.Cartesian3, Rn = new e.Cartographic;

    function On(e, t) {
        console.error(t), e._updateFailed = !0
    }

    customElements.define("cesium-coordinates", class extends ie {
        static get styles() {
            return [An, ee`:host{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;background-color:var(--widgets-transparent-background-color);border-radius:var(--widgets-container-border-radius);padding:.25em;font-size:.75rem}svg{width:1em;margin-right:.25em;vertical-align:text-top}span{display:inline-block}span:not(:first-child){margin-left:1.5em;margin-block-start:.1em}`]
        }

        constructor() {
            super(), this.show = !0, this.showAltitude = !0, this.showCameraAltitude = !0, this.degreesPrecision = 2, this.distancePrecision = 3, this._distanceUnits = e.DistanceUnits.METERS, this.locale = void 0, this.coordinateTransformFunction = void 0, this.coordinateFormat = [In.LONGITUDE, In.LATITUDE, In.DISTANCE, In.DISTANCE], this.getPositionCallback = void 0, this.mouseMoveTimeout = 300, this.unavailablePlaceholder = "Unavailable", this.longitudeLabel = "", this.latitudeLabel = "", this.altitudeLabel = "", this.cameraLabel = "Camera", this._pointerPosition = new e.Cartesian2, this.pointerPosition = void 0, this._moveTimeout = void 0, this._scene = void 0, this._lastCameraPosition = void 0, this._longitude = void 0, this._latitude = void 0, this._altitude = void 0, this._cameraAltitude = void 0, this._altitudeVisibleLimit = 1e5, this._formattedCoordinates = void 0, this._mouseIsMoving = !1, this._updateInProgress = !1, this._updateFailed = !1
        }

        static get properties() {
            return {
                show: {type: Boolean},
                showAltitude: {type: Boolean},
                showCameraAltitude: {type: Boolean},
                degreesPrecision: {type: Number},
                distancePrecision: {type: Number},
                latitudeLabel: {type: String},
                longitudeLabel: {type: String},
                altitudeLabel: {type: String},
                cameraLabel: {type: String},
                distanceUnits: {attribute: !1, type: String},
                locale: {attribute: !1, type: String},
                coordinateTransformFunction: {attribute: !1, type: Function},
                coordinateFormat: {attribute: !1, type: Array},
                getPositionCallback: {attribute: !1, type: Function},
                unavailablePlaceholder: {attribute: !1, type: String},
                pointerPosition: {type: Object},
                scene: {attribute: !1, type: Object},
                mouseMoveTimeout: {type: Number},
                _longitude: {attribute: !1, type: Number},
                _latitude: {attribute: !1, type: Number},
                _altitude: {attribute: !1, type: Number},
                _cameraAltitude: {attribute: !1, type: Number}
            }
        }

        get scene() {
            return this._scene
        }

        set scene(t) {
            this._preRenderSubscription && this._preRenderSubscription(), this._scene = t;
            const i = t.camera;
            this._lastCameraPosition = i.position.clone(), this._preRenderSubscription = t.preRender.addEventListener(() => {
                const t = i.position;
                e.defined(this.pointerPosition) && !e.Cartesian3.equals(this._lastCameraPosition, t) && (this._lastCameraPosition = t.clone(this._lastCameraPosition), this.handleMousePositionChanged())
            }, this)
        }

        get distanceUnits() {
            return this._distanceUnits
        }

        set distanceUnits(e) {
            this._distanceUnits !== e && (this._distanceUnits = e, this.updateUnits())
        }

        render() {
            if (this._updateFailed) return z`<p>${this.unavailablePlaceholder}</p><p></p>`;
            if (!e.defined(this._formattedCoordinates)) return z``;
            const t = this._formattedCoordinates.labels, i = this._formattedCoordinates.values;
            return z`${t.map((e, t) => z`<span>${e ? z`${e} ` : ""}${i[t]}</span>`)}`
        }

        updated(e) {
            e.has("pointerPosition") && this.handleMousePositionChanged()
        }

        handleMousePositionChanged() {
            this._pointerPosition.x = this.pointerPosition.x, this._pointerPosition.y = this.pointerPosition.y, this._mouseIsMoving ? this.mouseContinuedMoving() : (this._mouseIsMoving = !0, this.mouseStartedMoving()), e.defined(this._moveTimeout) && clearTimeout(this._moveTimeout), this._moveTimeout = setTimeout(() => {
                this._mouseIsMoving = !1, this.mouseStoppedMoving()
            }, this.mouseMoveTimeout)
        }

        _createPositionResult() {
            const e = this.scene.camera,
                t = {longitude: void 0, latitude: void 0, altitude: void 0, cameraAltitude: void 0};
            return t.cameraAltitude = e.positionCartographic.height, t
        }

        _updatePositionResult(t, i) {
            if (e.defined(i)) {
                const n = this.scene.globe.ellipsoid.cartesianToCartographic(i, Rn);
                e.defined(n) && (t.longitude = n.longitude, t.latitude = n.latitude, t.altitude = n.height)
            }
            return t
        }

        _fastPick() {
            const e = this.scene, t = this._createPositionResult(), i = e.camera.getPickRay(this._pointerPosition, Nn),
                n = e.globe.pick(i, e, zn);
            return this._updatePositionResult(t, n)
        }

        async _slowPick() {
            const t = this.scene, i = this._createPositionResult(t);
            let n;
            return n = e.defined(this.getPositionCallback) ? await this.getPositionCallback(t, this._pointerPosition) : e.getWorldPosition(t, this._pointerPosition, new e.Cartesian3), this._updatePositionResult(i, n)
        }

        async transformCoordinates() {
            const t = [this._longitude, this._latitude, this._altitude];
            if (e.defined(this.coordinateTransformFunction)) {
                const [e] = await this.coordinateTransformFunction([t]);
                return e
            }
            return t
        }

        formatCoordinate(t, i) {
            return i === In.LONGITUDE ? e.MeasureUnits.longitudeToString(t, e.AngleUnits.DEGREES_MINUTES_SECONDS, this.locale, this.degreesPrecision) : i === In.LATITUDE ? e.MeasureUnits.latitudeToString(t, e.AngleUnits.DEGREES_MINUTES_SECONDS, this.locale, this.degreesPrecision) : e.MeasureUnits.distanceToString(t, this.distanceUnits, this.locale, this.distancePrecision)
        }

        formatCoordinates(e) {
            const t = [this.longitudeLabel, this.latitudeLabel, this.altitudeLabel, this.cameraLabel],
                i = e.concat([this._cameraAltitude]), n = this.coordinateFormat,
                o = i.map((e, t) => this.formatCoordinate(e, n[t])), [r, a, s, c] = t, [l, d, u, h] = o, p = [r, a],
                m = [l, d];
            this._cameraAltitude < this._altitudeVisibleLimit && (this.showAltitude && this._altitude < this._altitudeVisibleLimit && Math.abs(this._altitude) > Math.abs(this._cameraAltitude) / 1e3 && (p.push(s), m.push(u)), this.showCameraAltitude && (p.push(c), m.push(h))), this._formattedCoordinates = {
                labels: p,
                values: m
            }
        }

        async updateCoordinates(t) {
            if (this._updateInProgress = !0, this._longitude = t.longitude, this._latitude = t.latitude, this._altitude = t.altitude, this._cameraAltitude = t.cameraAltitude, !e.defined(this._longitude) || !e.defined(this._latitude)) return void (this._updateInProgress = !1);
            const i = await this.transformCoordinates();
            this.formatCoordinates(i), this._updateInProgress = !1, this._updateFailed = !1, this.requestUpdate()
        }

        mouseStartedMoving() {
            const e = this._fastPick();
            this.updateCoordinates(e).catch(e => On(this, e))
        }

        mouseContinuedMoving() {
            if (this._updateInProgress) return;
            const e = this._fastPick();
            this.updateCoordinates(e).catch(e => On(this, e))
        }

        mouseStoppedMoving() {
            this._slowPick().then(e => this.updateCoordinates(e)).catch(e => On(this, e))
        }

        updateUnits() {
            this.updateCoordinates({
                longitude: this._longitude,
                latitude: this._latitude,
                altitude: this._altitude,
                cameraAltitude: this._cameraAltitude
            }).catch(e => On(this, e))
        }
    });
    const $n = new e.Ray;

    function Un(t, i, n) {
        let o;
        var r = t.camera.getPickRay(i, $n);
        if (t.pickPositionSupported) {
            var a = t.pick(i, 1, 1);
            e.defined(a) && (a instanceof e.Cesium3DTileFeature || a.primitive instanceof e.Cesium3DTileset || a.primitive instanceof e.Model) && (o = t.pickPosition(i, n))
        }
        if (e.defined(o) || (o = t.globe.pick(r, t, n)), e.defined(o)) return n
    }

    const jn = [.1, .2, .3, .5, 1, 2, 3, 5, 10, 20, 30, 50, 100, 200, 300, 500, 1e3, 2e3, 3e3, 5e3, 1e4, 2e4, 3e4, 5e4, 1e5, 2e5, 3e5, 5e5, 1e6, 2e6, 3e6, 5e6, 1e7, 2e7, 3e7, 5e7],
        Fn = [.5, 1, 2, 3, 6, 9, 15, 30, 60, 90, 150, 300, 600, 900, 1500, 3e3, 4500, 5280, 10560, 15840, 26400, 52800, 105600, 158400, 264e3, 528e3, 1056e3, 1584e3, 264e4, 528e4, 1056e4, 1584e4, 264e5, 528e5, 1056e5, 1584e5, 264e6],
        Vn = new e.EllipsoidGeodesic, Hn = new e.Cartesian2, qn = new e.Cartesian3, Bn = new e.Cartesian3;
    let Wn = new e.Ray, Yn = new e.Ray, Gn = new e.Cartographic, Jn = new e.Cartographic;

    function Kn(e, t, i, n, o) {
        return o ? Un(n, e, qn) : (Wn = t.getPickRay(e, Wn), i.pick(Wn, n, qn))
    }

    function Zn(e, t, i, n, o) {
        return o ? Un(n, e, Bn) : (Yn = t.getPickRay(e, Yn), i.pick(Yn, n, Bn))
    }

    customElements.define("cesium-map-scale", class extends ie {
        static get styles() {
            return [An, ee`:host{pointer-events:none;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.map-scale{color:var(--widgets-text-color);text-shadow:0 0 2px #000,0 0 2px #000,0 0 2px #000;height:30px;width:125px}.map-scale-distance-label{line-height:0;text-align:center;width:125px}.map-scale-bar{border:2px groove var(--widgets-text-color);border-top:none;position:absolute;height:10px;top:15px}`]
        }

        constructor() {
            super(), this._pointerPosition = new e.Cartesian2, this.pointerPosition = void 0, this.show = !0, this.distanceUnits = e.DistanceUnits.METERS, this.locale = void 0, this._scene = void 0, this._lastCameraPosition = void 0, this._forceUpdate = !1, this.maximumDistance = Number.POSITIVE_INFINITY, this._useScenePick = !1, this._moveTimeout = void 0, this.mouseMoveTimeout = 300, this._distance = 0, this._barWidth = "100px", this._barLeft = "50px"
        }

        static get properties() {
            return {
                show: {type: Boolean},
                scene: {attribute: !1, type: Object},
                mouseMoveTimeout: {type: Number},
                pointerPosition: {type: Object},
                distanceUnits: {attribute: !1, type: String},
                locale: {attribute: !1, type: String},
                _distance: {attribute: !1, type: Number},
                _barWidth: {attribute: !1, type: Number},
                _barLeft: {attribute: !1, type: Number},
                maximumDistance: {attribute: !1, type: Number}
            }
        }

        get scene() {
            return this._scene
        }

        set scene(t) {
            this._preRenderSubscription && this._preRenderSubscription(), this._scene = t;
            const i = t.camera;
            this._lastCameraPosition = i.position.clone(), this._preRenderSubscription = t.preRender.addEventListener(() => {
                const t = i.position;
                e.defined(this.pointerPosition) && !e.Cartesian3.equals(this._lastCameraPosition, t) && (this._lastCameraPosition = t.clone(this._lastCameraPosition), this._updateMapScale(), this._forceUpdate = !0)
            }, this)
        }

        get distance() {
            return this._distance
        }

        get distanceLabel() {
            return e.MeasureUnits.distanceToString(this._distance, this.distanceUnits, this.locale, 1, 0)
        }

        shouldUpdate(e) {
            return this._forceUpdate || e.has("pointerPosition") || e.has("distanceUnits") || this._useScenePick
        }

        render() {
            if (this._forceUpdate = !1, !this.show || !e.defined(this.pointerPosition)) return z``;
            if (this._useScenePick || (clearTimeout(this._moveTimeout), this._moveTimeout = setTimeout(() => {
                this._moveTimeout = void 0, this._useScenePick = !0, this.requestUpdate()
            }, this.mouseMoveTimeout)), this._updateMapScale(), this._useScenePick = !1, !e.defined(this._distance) || 0 === this._distance || this._distance > this.maximumDistance) return z``;
            const t = `width: ${this._barWidth}; left: ${this._barLeft}`;
            return z`<div class="map-scale"><div class="map-scale-distance-label"><p>${this.distanceLabel}</p></div><div class="map-scale-bar" style="${t}"></div></div>`
        }

        _updateMapScale() {
            const t = this._pointerPosition;
            t.x = this.pointerPosition.x, t.y = this.pointerPosition.y;
            const i = this.scene, n = i.canvas, o = n.clientWidth, r = n.clientHeight, a = i.camera, s = i.globe;
            let c, l, d, u;
            const h = this._useScenePick;
            if (c = Kn(t, a, s, i, h), e.defined(c) ? (Hn.x = t.x + 1, Hn.y = t.y, l = Zn(Hn, a, s, i, h)) : (Hn.x = o / 2 | 0, Hn.y = r - 1, c = Kn(Hn, a, s, i, h), Hn.x = 1 + o / 2 | 0, l = Zn(Hn, a, s, i, h)), e.defined(c) && e.defined(l) || (Hn.x = o / 2 | 0, Hn.y = r / 2 | 0, c = Kn(Hn, a, s, i, h), Hn.x = 1 + o / 2 | 0, l = Zn(Hn, a, s, i, h)), e.defined(c) && e.defined(l)) {
                const t = this.distanceUnits;
                d = function (e, t, i) {
                    const n = e.ellipsoid;
                    return Gn = n.cartesianToCartographic(t, Gn), Jn = n.cartesianToCartographic(i, Jn), Vn.setEndPoints(Gn, Jn), Vn.surfaceDistance
                }(s, c, l), d = e.MeasureUnits.convertDistance(d, e.DistanceUnits.METERS, t), u = function (e, t) {
                    for (let i = t.length - 1; i >= 0; --i) if (t[i] / e < 100) return t[i];
                    return t[0]
                }(d, t === e.DistanceUnits.METERS ? jn : Fn), this._distance = e.MeasureUnits.convertDistance(u, t, e.DistanceUnits.METERS)
            }
            if (e.defined(u) && u > 0) {
                const e = u / d | 0;
                this._barWidth = e + "px", this._barLeft = (125 - e) / 2 + "px"
            }
        }
    });

    class Xn extends ie {
        static get styles() {
            return [An, ee`:host{width:30px}.navigation-control{background-color:var(--widgets-background-color);cursor:pointer;border-bottom:1px solid var(--widgets-text-color)}.navigation-control:hover{background-color:var(--widgets-active-color)}:host(:first-child) .navigation-control{padding-top:5px;border-top-right-radius:14px;border-top-left-radius:14px}:host(:last-child) .navigation-control{padding-bottom:5px;border-bottom:none;border-bottom-right-radius:14px;border-bottom-left-radius:14px}.navigation-control>div{position:relative;text-align:center;font-size:20px;color:var(--widgets-text-color)}.navigation-control-icon-reset{font-size:16px;fill:var(--widgets-text-color)}.navigation-control-icon-zoom-in{padding-bottom:4px}`]
        }

        constructor() {
            super(), this.scene = void 0, this.title = "Unnamed Control", this.text = void 0, this.svgIcon = void 0, this.svgHeight = void 0, this.svgWidth = void 0, this.cssClass = void 0, this.ready = !1
        }

        attach(e) {
            this.scene = e, this.ready = !0, this.requestUpdate()
        }

        render() {
            return z`<div class="navigation-control" @click="${this.activate}" title="${this.title}">${this.hasText ? z`<div class="${this.cssClass}">${this.text}</div>` : z`<div class="${this.cssClass}">${this.svgIcon}</div>`}</div>`
        }

        get hasText() {
            return e.defined(this.text) && "string" == typeof this.text
        }

        flyToPosition(t, i, n) {
            const o = t.camera.position, r = i;
            n = e.defaultValue(n, 200);
            const a = t.screenSpaceCameraController;
            a.enableInputs = !1, t.tweens.add({
                duration: n / 1e3,
                easingFunction: e.Tween.Easing.Sinusoidal.InOut,
                startObject: {time: 0},
                stopObject: {time: 1},
                update: function (i) {
                    t.isDestroyed() || (t.camera.position.x = e.Math.lerp(o.x, r.x, i.time), t.camera.position.y = e.Math.lerp(o.y, r.y, i.time), t.camera.position.z = e.Math.lerp(o.z, r.z, i.time))
                },
                complete: function () {
                    a.isDestroyed() || (a.enableInputs = !0)
                },
                cancel: function () {
                    a.isDestroyed() || (a.enableInputs = !0)
                }
            })
        }

        getCameraFocus(t) {
            const i = new e.Ray(t.camera.positionWC, t.camera.directionWC),
                n = e.IntersectionTests.rayEllipsoid(i, e.Ellipsoid.WGS84);
            return e.defined(n) ? e.Ray.getPoint(i, n.start) : e.IntersectionTests.grazingAltitudeLocation(i, e.Ellipsoid.WGS84)
        }
    }

    const Qn = z`<svg height="28" width="28" viewBox="0 0 28 28"><path d="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z"></path></svg>`;
    customElements.define("cesium-navigation-reset", class extends Xn {
        constructor() {
            super(), this.title = "Reset View", this.svgIcon = Qn, this.cssClass = "navigation-control-icon-reset"
        }

        resetView() {
            this.scene.camera.flyHome()
        }

        activate() {
            this.resetView()
        }
    });
    const eo = new e.Cartesian3;
    customElements.define("cesium-navigation-zoom-in", class extends Xn {
        constructor() {
            super(), this.title = "Zoom In", this.text = "+", this.cssClass = "navigation-control-icon-zoom-in"
        }

        zoomIn() {
            const t = this.scene, i = t.camera, n = this.getCameraFocus(t),
                o = e.Cartesian3.subtract(n, i.position, eo), r = e.Cartesian3.multiplyByScalar(o, 2 / 3, eo),
                a = e.Cartesian3.add(i.position, r, eo);
            this.flyToPosition(t, a)
        }

        activate() {
            this.zoomIn()
        }
    });
    const to = new e.Cartesian3;
    customElements.define("cesium-navigation-zoom-out", class extends Xn {
        constructor(e) {
            super(e), this.title = "Zoom Out", this.text = "-", this.cssClass = "navigation-control-icon-zoom-out"
        }

        zoomOut() {
            const t = this.scene, i = t.camera, n = this.getCameraFocus(t),
                o = e.Cartesian3.subtract(n, i.position, to), r = e.Cartesian3.multiplyByScalar(o, -2, to),
                a = e.Cartesian3.add(i.position, r, to);
            this.flyToPosition(t, a)
        }

        activate() {
            this.zoomOut()
        }
    });
    const io = z`<svg height="145" width="145" viewBox="0 0 145 145"><path d="m 66.5625,0 0,15.15625 3.71875,0 0,-10.40625 5.5,10.40625 4.375,0 0,-15.15625 -3.71875,0 0,10.40625 L 70.9375,0 66.5625,0 z M 72.5,20.21875 c -28.867432,0 -52.28125,23.407738 -52.28125,52.28125 0,28.87351 23.413818,52.3125 52.28125,52.3125 28.86743,0 52.28125,-23.43899 52.28125,-52.3125 0,-28.873512 -23.41382,-52.28125 -52.28125,-52.28125 z m 0,1.75 c 13.842515,0 26.368948,5.558092 35.5,14.5625 l -11.03125,11 0.625,0.625 11.03125,-11 c 8.9199,9.108762 14.4375,21.579143 14.4375,35.34375 0,13.764606 -5.5176,26.22729 -14.4375,35.34375 l -11.03125,-11 -0.625,0.625 11.03125,11 c -9.130866,9.01087 -21.658601,14.59375 -35.5,14.59375 -13.801622,0 -26.321058,-5.53481 -35.4375,-14.5 l 11.125,-11.09375 c 6.277989,6.12179 14.857796,9.90625 24.3125,9.90625 19.241896,0 34.875,-15.629154 34.875,-34.875 0,-19.245847 -15.633104,-34.84375 -34.875,-34.84375 -9.454704,0 -18.034511,3.760884 -24.3125,9.875 L 37.0625,36.4375 C 46.179178,27.478444 58.696991,21.96875 72.5,21.96875 z m -0.875,0.84375 0,13.9375 1.75,0 0,-13.9375 -1.75,0 z M 36.46875,37.0625 47.5625,48.15625 C 41.429794,54.436565 37.65625,63.027539 37.65625,72.5 c 0,9.472461 3.773544,18.055746 9.90625,24.34375 L 36.46875,107.9375 c -8.96721,-9.1247 -14.5,-21.624886 -14.5,-35.4375 0,-13.812615 5.53279,-26.320526 14.5,-35.4375 z M 72.5,39.40625 c 18.297686,0 33.125,14.791695 33.125,33.09375 0,18.302054 -14.827314,33.125 -33.125,33.125 -18.297687,0 -33.09375,-14.822946 -33.09375,-33.125 0,-18.302056 14.796063,-33.09375 33.09375,-33.09375 z M 22.84375,71.625 l 0,1.75 13.96875,0 0,-1.75 -13.96875,0 z m 85.5625,0 0,1.75 14,0 0,-1.75 -14,0 z M 71.75,108.25 l 0,13.9375 1.71875,0 0,-13.9375 -1.71875,0 z"></path></svg>`,
        no = z`<svg height="145" width="145" viewBox="0 0 145 145"><path d="m 72.71875,54.375 c -0.476702,0 -0.908208,0.245402 -1.21875,0.5625 -0.310542,0.317098 -0.551189,0.701933 -0.78125,1.1875 -0.172018,0.363062 -0.319101,0.791709 -0.46875,1.25 -6.91615,1.075544 -12.313231,6.656514 -13,13.625 -0.327516,0.117495 -0.661877,0.244642 -0.9375,0.375 -0.485434,0.22959 -0.901634,0.471239 -1.21875,0.78125 -0.317116,0.310011 -0.5625,0.742111 -0.5625,1.21875 l 0.03125,0 c 0,0.476639 0.245384,0.877489 0.5625,1.1875 0.317116,0.310011 0.702066,0.58291 1.1875,0.8125 0.35554,0.168155 0.771616,0.32165 1.21875,0.46875 1.370803,6.10004 6.420817,10.834127 12.71875,11.8125 0.146999,0.447079 0.30025,0.863113 0.46875,1.21875 0.230061,0.485567 0.470708,0.870402 0.78125,1.1875 0.310542,0.317098 0.742048,0.5625 1.21875,0.5625 0.476702,0 0.876958,-0.245402 1.1875,-0.5625 0.310542,-0.317098 0.582439,-0.701933 0.8125,-1.1875 0.172018,-0.363062 0.319101,-0.791709 0.46875,-1.25 6.249045,-1.017063 11.256351,-5.7184 12.625,-11.78125 0.447134,-0.1471 0.86321,-0.300595 1.21875,-0.46875 0.485434,-0.22959 0.901633,-0.502489 1.21875,-0.8125 0.317117,-0.310011 0.5625,-0.710861 0.5625,-1.1875 l -0.03125,0 c 0,-0.476639 -0.245383,-0.908739 -0.5625,-1.21875 C 89.901633,71.846239 89.516684,71.60459 89.03125,71.375 88.755626,71.244642 88.456123,71.117495 88.125,71 87.439949,64.078341 82.072807,58.503735 75.21875,57.375 c -0.15044,-0.461669 -0.326927,-0.884711 -0.5,-1.25 -0.230061,-0.485567 -0.501958,-0.870402 -0.8125,-1.1875 -0.310542,-0.317098 -0.710798,-0.5625 -1.1875,-0.5625 z m -0.0625,1.40625 c 0.03595,-0.01283 0.05968,0 0.0625,0 0.0056,0 0.04321,-0.02233 0.1875,0.125 0.144288,0.147334 0.34336,0.447188 0.53125,0.84375 0.06385,0.134761 0.123901,0.309578 0.1875,0.46875 -0.320353,-0.01957 -0.643524,-0.0625 -0.96875,-0.0625 -0.289073,0 -0.558569,0.04702 -0.84375,0.0625 C 71.8761,57.059578 71.936151,56.884761 72,56.75 c 0.18789,-0.396562 0.355712,-0.696416 0.5,-0.84375 0.07214,-0.07367 0.120304,-0.112167 0.15625,-0.125 z m 0,2.40625 c 0.448007,0 0.906196,0.05436 1.34375,0.09375 0.177011,0.592256 0.347655,1.271044 0.5,2.03125 0.475097,2.370753 0.807525,5.463852 0.9375,8.9375 -0.906869,-0.02852 -1.834463,-0.0625 -2.78125,-0.0625 -0.92298,0 -1.802327,0.03537 -2.6875,0.0625 0.138529,-3.473648 0.493653,-6.566747 0.96875,-8.9375 0.154684,-0.771878 0.320019,-1.463985 0.5,-2.0625 0.405568,-0.03377 0.804291,-0.0625 1.21875,-0.0625 z m -2.71875,0.28125 c -0.129732,0.498888 -0.259782,0.987558 -0.375,1.5625 -0.498513,2.487595 -0.838088,5.693299 -0.96875,9.25 -3.21363,0.15162 -6.119596,0.480068 -8.40625,0.9375 -0.682394,0.136509 -1.275579,0.279657 -1.84375,0.4375 0.799068,-6.135482 5.504716,-11.036454 11.59375,-12.1875 z M 75.5,58.5 c 6.043169,1.18408 10.705093,6.052712 11.5,12.15625 -0.569435,-0.155806 -1.200273,-0.302525 -1.875,-0.4375 -2.262525,-0.452605 -5.108535,-0.783809 -8.28125,-0.9375 -0.130662,-3.556701 -0.470237,-6.762405 -0.96875,-9.25 C 75.761959,59.467174 75.626981,58.990925 75.5,58.5 z m -2.84375,12.09375 c 0.959338,0 1.895843,0.03282 2.8125,0.0625 C 75.48165,71.267751 75.5,71.871028 75.5,72.5 c 0,1.228616 -0.01449,2.438313 -0.0625,3.59375 -0.897358,0.0284 -1.811972,0.0625 -2.75,0.0625 -0.927373,0 -1.831062,-0.03473 -2.71875,-0.0625 -0.05109,-1.155437 -0.0625,-2.365134 -0.0625,-3.59375 0,-0.628972 0.01741,-1.232249 0.03125,-1.84375 0.895269,-0.02827 1.783025,-0.0625 2.71875,-0.0625 z M 68.5625,70.6875 c -0.01243,0.60601 -0.03125,1.189946 -0.03125,1.8125 0,1.22431 0.01541,2.407837 0.0625,3.5625 -3.125243,-0.150329 -5.92077,-0.471558 -8.09375,-0.90625 -0.784983,-0.157031 -1.511491,-0.316471 -2.125,-0.5 -0.107878,-0.704096 -0.1875,-1.422089 -0.1875,-2.15625 0,-0.115714 0.02849,-0.228688 0.03125,-0.34375 0.643106,-0.20284 1.389577,-0.390377 2.25,-0.5625 2.166953,-0.433487 4.97905,-0.75541 8.09375,-0.90625 z m 8.3125,0.03125 c 3.075121,0.15271 5.824455,0.446046 7.96875,0.875 0.857478,0.171534 1.630962,0.360416 2.28125,0.5625 0.0027,0.114659 0,0.228443 0,0.34375 0,0.735827 -0.07914,1.450633 -0.1875,2.15625 -0.598568,0.180148 -1.29077,0.34562 -2.0625,0.5 -2.158064,0.431708 -4.932088,0.754666 -8.03125,0.90625 0.04709,-1.154663 0.0625,-2.33819 0.0625,-3.5625 0,-0.611824 -0.01924,-1.185379 -0.03125,-1.78125 z M 57.15625,72.5625 c 0.0023,0.572772 0.06082,1.131112 0.125,1.6875 -0.125327,-0.05123 -0.266577,-0.10497 -0.375,-0.15625 -0.396499,-0.187528 -0.665288,-0.387337 -0.8125,-0.53125 -0.147212,-0.143913 -0.15625,-0.182756 -0.15625,-0.1875 0,-0.0047 -0.02221,-0.07484 0.125,-0.21875 0.147212,-0.143913 0.447251,-0.312472 0.84375,-0.5 0.07123,-0.03369 0.171867,-0.06006 0.25,-0.09375 z m 31.03125,0 c 0.08201,0.03503 0.175941,0.05872 0.25,0.09375 0.396499,0.187528 0.665288,0.356087 0.8125,0.5 0.14725,0.14391 0.15625,0.21405 0.15625,0.21875 0,0.0047 -0.009,0.04359 -0.15625,0.1875 -0.147212,0.143913 -0.416001,0.343722 -0.8125,0.53125 -0.09755,0.04613 -0.233314,0.07889 -0.34375,0.125 0.06214,-0.546289 0.09144,-1.094215 0.09375,-1.65625 z m -29.5,3.625 c 0.479308,0.123125 0.983064,0.234089 1.53125,0.34375 2.301781,0.460458 5.229421,0.787224 8.46875,0.9375 0.167006,2.84339 0.46081,5.433176 0.875,7.5 0.115218,0.574942 0.245268,1.063612 0.375,1.5625 -5.463677,-1.028179 -9.833074,-5.091831 -11.25,-10.34375 z m 27.96875,0 C 85.247546,81.408945 80.919274,85.442932 75.5,86.5 c 0.126981,-0.490925 0.261959,-0.967174 0.375,-1.53125 0.41419,-2.066824 0.707994,-4.65661 0.875,-7.5 3.204493,-0.15162 6.088346,-0.480068 8.375,-0.9375 0.548186,-0.109661 1.051942,-0.220625 1.53125,-0.34375 z M 70.0625,77.53125 c 0.865391,0.02589 1.723666,0.03125 2.625,0.03125 0.912062,0 1.782843,-0.0048 2.65625,-0.03125 -0.165173,2.736408 -0.453252,5.207651 -0.84375,7.15625 -0.152345,0.760206 -0.322989,1.438994 -0.5,2.03125 -0.437447,0.03919 -0.895856,0.0625 -1.34375,0.0625 -0.414943,0 -0.812719,-0.02881 -1.21875,-0.0625 -0.177011,-0.592256 -0.347655,-1.271044 -0.5,-2.03125 -0.390498,-1.948599 -0.700644,-4.419842 -0.875,-7.15625 z m 1.75,10.28125 c 0.284911,0.01545 0.554954,0.03125 0.84375,0.03125 0.325029,0 0.648588,-0.01171 0.96875,-0.03125 -0.05999,0.148763 -0.127309,0.31046 -0.1875,0.4375 -0.18789,0.396562 -0.386962,0.696416 -0.53125,0.84375 -0.144288,0.147334 -0.181857,0.125 -0.1875,0.125 -0.0056,0 -0.07446,0.02233 -0.21875,-0.125 C 72.355712,88.946416 72.18789,88.646562 72,88.25 71.939809,88.12296 71.872486,87.961263 71.8125,87.8125 z"></path></svg>`,
        oo = z`<svg height="145" width="145" viewBox="0 0 145 145"><path d="M 72.46875,22.03125 C 59.505873,22.050338 46.521615,27.004287 36.6875,36.875 L 47.84375,47.96875 C 61.521556,34.240041 83.442603,34.227389 97.125,47.90625 l 11.125,-11.125 C 98.401629,26.935424 85.431627,22.012162 72.46875,22.03125 z"></path></svg>`,
        ro = new e.Cartesian2, ao = new e.Matrix4, so = new e.Matrix4, co = new e.Cartesian3, lo = new e.Cartesian2,
        uo = new e.Ray;

    function ho(t, i, n) {
        const o = Math.atan2(-i.y, i.x);
        t.orbitCursorAngle = e.Math.zeroToTwoPi(o - e.Math.PI_OVER_TWO);
        const r = e.Cartesian2.magnitude(i), a = n / 2, s = Math.min(r / a, 1), c = .5 * s * s + .5;
        t.orbitCursorOpacity = c
    }

    customElements.define("cesium-navigation", class extends ie {
        static get styles() {
            return [An, ee`:host{position:relative;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}:host *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.navigation-controls{pointer-events:auto;position:absolute;right:30px;top:90px;width:30px;font-weight:300;-webkit-touch-callout:none;border:1px solid var(--widgets-text-color);border-radius:15px}.compass{cursor:pointer;touch-action:none;pointer-events:auto;position:absolute;right:0;top:0;width:95px;height:95px}.compass-outer-ring{position:absolute;top:0;width:95px;height:95px;fill:var(--widgets-text-color);stroke:var(--widgets-default-color)}.compass-outer-ring-background{position:absolute;top:14px;left:14px;width:44px;height:44px;border-radius:44px;border:12px solid var(--widgets-background-color)}.compass-gyro{pointer-events:none;position:absolute;top:0;width:95px;height:95px;fill:var(--widgets-text-color)}.compass-gyro-background{position:absolute;top:30px;left:30px;width:33px;height:33px;border-radius:33px;background-color:var(--widgets-background-color);border:1px solid var(--widgets-text-color)}.compass-gyro-background.active,.compass-gyro-background:hover{background-color:var(--widgets-active-color)}.compass-rotation-marker{position:absolute;top:0;width:95px;height:95px;fill:var(--widgets-active-color)}svg{position:absolute;top:0;left:0;width:100%;height:100%}`]
        }

        static get properties() {
            return {
                showCompass: {type: Boolean},
                heading: {type: Number},
                isOrbiting: {type: Boolean},
                orbitCursorAngle: {type: Number},
                orbitCursorOpacity: {type: Number},
                isRotating: {type: Boolean}
            }
        }

        constructor() {
            super(), this._scene = void 0, this.clock = void 0, this.controls = [], this._postRenderSubscription = void 0, this.svgCompassOuterRing = io, this.svgCompassGyro = no, this.svgCompassRotationMarker = oo, this.showCompass = !0, this.heading = 0, this.isOrbiting = !1, this.orbitCursorAngle = 0, this.orbitCursorOpacity = 0, this.orbitLastTimestamp = 0, this.orbitFrame = void 0, this.orbitIsLook = !1, this.orbitMouseMoveFunction = void 0, this.orbitMouseUpFunction = void 0, this.isRotating = !1, this.rotateInitialCursorAngle = void 0, this.rotateFrame = void 0, this.rotateIsLook = !1, this.rotateMouseMoveFunction = void 0, this.rotateMouseUpFunction = void 0, this.ready = !1
        }

        attach(e, t) {
            this._scene = e, this.clock = t, this._postRenderSubscription = e.postRender.addEventListener((function () {
                this.heading = e.camera.heading
            }), this), this.ready = !0, this.requestUpdate()
        }

        firstUpdated() {
            this.shadowRoot.querySelectorAll(".navigation-controls > *").forEach(e => e.attach(this._scene))
        }

        handleMouseDown(t) {
            const i = t.currentTarget, n = t.currentTarget.getBoundingClientRect(), o = n.width / 2,
                r = new e.Cartesian2((n.right - n.left) / 2, (n.bottom - n.top) / 2),
                a = new e.Cartesian2(t.clientX - n.left, t.clientY - n.top), s = e.Cartesian2.subtract(a, r, ro),
                c = e.Cartesian2.magnitude(s) / o;
            c < 50 / 145 ? function (t, i, n) {
                document.removeEventListener("pointermove", t.orbitMouseMoveFunction, !1), document.removeEventListener("pointerup", t.orbitMouseUpFunction, !1), e.defined(t.orbitTickFunction) && t.clock.onTick.removeEventListener(t.orbitTickFunction), t.orbitMouseMoveFunction = void 0, t.orbitMouseUpFunction = void 0, t.orbitTickFunction = void 0, t.isOrbiting = !0, t.orbitLastTimestamp = e.getTimestamp();
                const o = t._scene, r = o.camera, a = lo;
                a.x = o.canvas.clientWidth / 2, a.y = o.canvas.clientHeight / 2;
                const s = r.getPickRay(a, uo), c = o.globe.pick(s, o, co);
                e.defined(c) ? (t.orbitFrame = e.Transforms.eastNorthUpToFixedFrame(c, e.Ellipsoid.WGS84, so), t.orbitIsLook = !1) : (t.orbitFrame = e.Transforms.eastNorthUpToFixedFrame(r.positionWC, e.Ellipsoid.WGS84, so), t.orbitIsLook = !0), t.orbitTickFunction = function () {
                    const i = e.getTimestamp(),
                        n = (i - t.orbitLastTimestamp) * (2.5 * (t.orbitCursorOpacity - .5) / 1e3),
                        o = t.orbitCursorAngle + e.Math.PI_OVER_TWO, r = Math.cos(o) * n, a = Math.sin(o) * n,
                        s = t._scene.camera, c = e.Matrix4.clone(s.transform, ao);
                    s.lookAtTransform(t.orbitFrame), t.orbitIsLook ? (s.look(e.Cartesian3.UNIT_Z, -r), s.look(s.right, -a)) : (s.rotateLeft(r), s.rotateUp(a)), s.lookAtTransform(c), t.orbitLastTimestamp = i
                }, t.orbitMouseMoveFunction = function (n) {
                    const o = i.getBoundingClientRect(),
                        r = new e.Cartesian2((o.right - o.left) / 2, (o.bottom - o.top) / 2),
                        a = new e.Cartesian2(n.clientX - o.left, n.clientY - o.top),
                        s = e.Cartesian2.subtract(a, r, ro);
                    ho(t, s, o.width)
                }, t.orbitMouseUpFunction = function () {
                    t.isOrbiting = !1, document.removeEventListener("pointermove", t.orbitMouseMoveFunction, !1), document.removeEventListener("pointerup", t.orbitMouseUpFunction, !1), e.defined(t.orbitTickFunction) && t.clock.onTick.removeEventListener(t.orbitTickFunction), t.orbitMouseMoveFunction = void 0, t.orbitMouseUpFunction = void 0, t.orbitTickFunction = void 0
                }, document.addEventListener("pointermove", t.orbitMouseMoveFunction, !1), document.addEventListener("pointerup", t.orbitMouseUpFunction, !1), t.clock.onTick.addEventListener(t.orbitTickFunction), ho(t, n, i.getBoundingClientRect().width)
            }(this, i, s) : c < 1 && function (t, i, n) {
                document.removeEventListener("pointermove", t.rotateMouseMoveFunction, !1), document.removeEventListener("pointerup", t.rotateMouseUpFunction, !1), t.rotateMouseMoveFunction = void 0, t.rotateMouseUpFunction = void 0, t.isRotating = !0, t.rotateInitialCursorAngle = Math.atan2(-n.y, n.x);
                const o = t._scene, r = o.camera, a = lo;
                a.x = o.canvas.clientWidth / 2, a.y = o.canvas.clientHeight / 2;
                const s = r.getPickRay(a, uo), c = o.globe.pick(s, o, co);
                e.defined(c) ? (t.rotateFrame = e.Transforms.eastNorthUpToFixedFrame(c, e.Ellipsoid.WGS84, so), t.rotateIsLook = !1) : (t.rotateFrame = e.Transforms.eastNorthUpToFixedFrame(r.positionWC, e.Ellipsoid.WGS84, so), t.rotateIsLook = !0);
                const l = e.Matrix4.clone(r.transform, ao);
                r.lookAtTransform(t.rotateFrame), t.rotateInitialCameraAngle = Math.atan2(r.position.y, r.position.x), t.rotateInitialCameraDistance = e.Cartesian3.magnitude(new e.Cartesian3(r.position.x, r.position.y, 0)), r.lookAtTransform(l), t.rotateMouseMoveFunction = function (n) {
                    const o = i.getBoundingClientRect(),
                        r = new e.Cartesian2((o.right - o.left) / 2, (o.bottom - o.top) / 2),
                        a = new e.Cartesian2(n.clientX - o.left, n.clientY - o.top),
                        s = e.Cartesian2.subtract(a, r, ro), c = Math.atan2(-s.y, s.x) - t.rotateInitialCursorAngle,
                        l = e.Math.zeroToTwoPi(t.rotateInitialCameraAngle - c), d = t._scene.camera,
                        u = e.Matrix4.clone(d.transform, ao);
                    d.lookAtTransform(t.rotateFrame);
                    const h = Math.atan2(d.position.y, d.position.x);
                    d.rotateRight(l - h), d.lookAtTransform(u)
                }, t.rotateMouseUpFunction = function () {
                    t.isRotating = !1, document.removeEventListener("pointermove", t.rotateMouseMoveFunction, !1), document.removeEventListener("pointerup", t.rotateMouseUpFunction, !1), t.rotateMouseMoveFunction = void 0, t.rotateMouseUpFunction = void 0
                }, document.addEventListener("pointermove", t.rotateMouseMoveFunction, !1), document.addEventListener("pointerup", t.rotateMouseUpFunction, !1)
            }(this, i, s)
        }

        handleDoubleClick() {
            const t = this._scene, i = t.camera, n = lo;
            n.x = t.canvas.clientWidth / 2, n.y = t.canvas.clientHeight / 2;
            const o = i.getPickRay(n, uo), r = t.globe.pick(o, t, co);
            if (!e.defined(r)) return void this.controls[1].resetView();
            const a = e.Transforms.eastNorthUpToFixedFrame(r),
                s = e.Cartesian3.subtract(r, i.position, new e.Cartesian3), c = e.CameraFlightPath.createTween(t, {
                    destination: e.Matrix4.multiplyByPoint(a, new e.Cartesian3(0, 0, e.Cartesian3.magnitude(s)), new e.Cartesian3),
                    direction: e.Matrix4.multiplyByPointAsVector(a, new e.Cartesian3(0, 0, -1), new e.Cartesian3),
                    up: e.Matrix4.multiplyByPointAsVector(a, new e.Cartesian3(0, 1, 0), new e.Cartesian3),
                    duration: 1.5
                });
            t.tweens.add(c)
        }

        get rotationStyle() {
            return `transform: rotate(-${this.orbitCursorAngle}rad); -webkit-transform: rotate(-${this.orbitCursorAngle}rad); opacity: ${this.orbitCursorOpacity};`
        }

        get outerRingStyle() {
            return `transform: rotate(-${this.heading}rad); -webkit-transform: rotate(-${this.heading}rad);`
        }

        render() {
            return this.ready ? z`<div class="compass" ?hidden="${!this.showCompass}" touch-action="none" @pointerdown="${this.handleMouseDown}" @dblclick="${this.handleDoubleClick}"><div class="compass-outer-ring-background"></div><div class="compass-rotation-marker" ?hidden="${!this.isOrbiting}" style="${this.rotationStyle}">${oo}</div><div class="compass-outer-ring" title="Click and drag to rotate the camera" style="${this.outerRingStyle}">${io}</div><div class="compass-gyro-background ${this.isOrbiting ? "active" : ""}"></div><div class="compass-gyro">${no}</div></div><div class="navigation-controls"><cesium-navigation-zoom-in></cesium-navigation-zoom-in><cesium-navigation-reset></cesium-navigation-reset><cesium-navigation-zoom-out></cesium-navigation-zoom-out></div>` : z``
        }
    });
    const {Check: po, defaultValue: mo} = t, fo = {METRIC: "METRIC", US_CUSTOMARY: "US_CUSTOMARY"};

    function go(e, t) {
        return t = mo(t, 1), e * Math.pow(.001, t)
    }

    function bo(e, t) {
        return t = mo(t, 1), e * Math.pow(100, t)
    }

    function vo(e, t) {
        return t = mo(t, 1), e * Math.pow(12, t)
    }

    function _o(e, t) {
        return t = mo(t, 1), e * Math.pow(1 / 5280, t)
    }

    fo.toString = function (e) {
        return e === fo.METRIC ? "Metric" : e === fo.US_CUSTOMARY ? "US Customary" : ""
    }, fo.distanceToString = function (e, t, i) {
        let n;
        return i = mo(i, 3), t === fo.METRIC ? (n = Math.abs(e), n < 1 ? bo(e).toFixed(i) + "cm" : n >= 1e3 ? go(e).toFixed(i) + "km" : e.toFixed(i) + "m") : (o = e, r = mo(r, 1), e = o * Math.pow(100 / 30.48, r), n = Math.abs(e), n < 1 ? vo(e).toFixed(i) + "in" : n >= 5280 ? _o(e).toFixed(i) + "mi" : e.toFixed(i) + "ft");
        var o, r
    }, fo.areaToString = function (e, t, i) {
        i = mo(i, 3);
        const n = Math.abs(e);
        return t === fo.METRIC ? n < .1 ? bo(e, 2).toFixed(i) + "sq cm" : n >= 1e6 ? go(e, 2).toFixed(i) + "sq km" : e.toFixed(i) + "sq m" : n < 1 ? vo(e, 2).toFixed(i) + "sq in" : n >= 278784 ? _o(e, 2).toFixed(i) + "sq mi" : e.toFixed(i) + "sq ft"
    };
    var wo = Object.freeze(fo);

    function yo(t, i, n) {
        const o = t.scene.camera;
        if (i instanceof e.CzmlDataSource || i instanceof e.KmlDataSource || i instanceof e.GeoJsonDataSource) {
            const o = t.clockViewModel.clock, r = i.clock;
            if (e.defined(r)) {
                const t = r.startTime, i = r.stopTime;
                (e.JulianDate.lessThan(o.currentTime, t) || e.JulianDate.greaterThan(o.currentTime, i)) && (o.currentTime = t.clone())
            }
            t.flyTo(i, {duration: n})
        } else if (i instanceof e.ImageryLayer) t.flyTo(i, {duration: n}); else {
            if (!(i instanceof e.Cesium3DTileset)) throw new e.DeveloperError("Failed to zoom to unrecognized data type.");
            i.readyPromise.then((function (t) {
                o.flyToBoundingSphere(t.boundingSphere, {endTransform: e.Matrix4.IDENTITY, duration: n})
            }))
        }
    }

    var xo = [ee`${Q(".cesium-svgPath-svg{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden}.cesium-button{display:inline-block;position:relative;background:#303336;border:1px solid #444;color:#edffff;fill:#edffff;border-radius:4px;padding:5px 12px;margin:2px 3px;cursor:pointer;overflow:hidden;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.cesium-button:focus{color:#fff;fill:#fff;border-color:#ea4;outline:0}.cesium-button:hover{color:#fff;fill:#fff;background:#48b;border-color:#aef;box-shadow:0 0 8px #fff}.cesium-button:active{color:#000;fill:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff}.cesium-button-disabled,.cesium-button-disabled:active,.cesium-button-disabled:focus,.cesium-button-disabled:hover,.cesium-button:disabled{background:#303336;border-color:#444;color:#646464;fill:#646464;box-shadow:none;cursor:default}.cesium-button option{background-color:#000;color:#eee}.cesium-button option:disabled{color:#777}.cesium-button input,.cesium-button label{cursor:pointer}.cesium-button input{vertical-align:sub}.cesium-toolbar-button{box-sizing:border-box;width:32px;height:32px;border-radius:14%;padding:0;vertical-align:middle;z-index:0}.cesium-performanceDisplay-defaultContainer{position:absolute;top:50px;right:10px;text-align:right}.cesium-performanceDisplay{background-color:rgba(40,40,40,.7);padding:7px;border-radius:5px;border:1px solid #444;font:bold 12px sans-serif}.cesium-performanceDisplay-fps{color:#e52}.cesium-performanceDisplay-throttled{color:#a42}.cesium-performanceDisplay-ms{color:#de3}.cesium-animation-theme{visibility:hidden;display:block;position:absolute;z-index:-100}.cesium-animation-themeNormal{color:#222}.cesium-animation-themeHover{color:#4488b0}.cesium-animation-themeSelect{color:#242}.cesium-animation-themeDisabled{color:#333}.cesium-animation-themeKnob{color:#222}.cesium-animation-themePointer{color:#2e2}.cesium-animation-themeSwoosh{color:#8ac}.cesium-animation-themeSwooshHover{color:#aef}.cesium-animation-svgText{fill:#edffff;font-family:Sans-Serif;font-size:15px;text-anchor:middle}.cesium-animation-blank{fill:#000;fill-opacity:.01;stroke:none}.cesium-animation-rectButton{cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.cesium-animation-rectButton .cesium-animation-buttonGlow{fill:#fff;stroke:none;display:none}.cesium-animation-rectButton:hover .cesium-animation-buttonGlow{display:block}.cesium-animation-rectButton .cesium-animation-buttonPath{fill:#edffff}.cesium-animation-rectButton .cesium-animation-buttonMain{stroke:#444;stroke-width:1.2}.cesium-animation-rectButton:hover .cesium-animation-buttonMain{stroke:#aef}.cesium-animation-rectButton:active .cesium-animation-buttonMain{fill:#abd6ff}.cesium-animation-buttonDisabled{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.cesium-animation-buttonDisabled .cesium-animation-buttonMain{stroke:#555}.cesium-animation-buttonDisabled .cesium-animation-buttonPath{fill:#818181}.cesium-animation-buttonDisabled .cesium-animation-buttonGlow{display:none}.cesium-animation-buttonToggled .cesium-animation-buttonGlow{display:block;fill:#2e2}.cesium-animation-buttonToggled .cesium-animation-buttonMain{stroke:#2e2}.cesium-animation-buttonToggled:hover .cesium-animation-buttonGlow{fill:#fff}.cesium-animation-buttonToggled:hover .cesium-animation-buttonMain{stroke:#2e2}.cesium-animation-shuttleRingG{cursor:pointer}.cesium-animation-shuttleRingPointer{cursor:pointer}.cesium-animation-shuttleRingPausePointer{cursor:pointer}.cesium-animation-shuttleRingBack{fill:#181818;fill-opacity:.8;stroke:#333;stroke-width:1.2}.cesium-animation-shuttleRingSwoosh line{stroke:#8ac;stroke-width:3;stroke-opacity:.2;stroke-linecap:round}.cesium-animation-knobOuter{cursor:pointer;stroke:#444;stroke-width:1.2}.cesium-animation-knobInner{cursor:pointer}.cesium-baseLayerPicker-selected{position:absolute;top:0;left:0;width:100%;height:100%;border:none}.cesium-baseLayerPicker-dropDown{display:block;position:absolute;box-sizing:content-box;top:auto;right:0;width:320px;max-height:500px;margin-top:5px;background-color:rgba(38,38,38,.75);border:1px solid #444;padding:6px;overflow:auto;border-radius:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;transform:translate(0,-20%);visibility:hidden;opacity:0;transition:visibility 0s .2s,opacity .2s ease-in,transform .2s ease-in}.cesium-baseLayerPicker-dropDown-visible{transform:translate(0,0);visibility:visible;opacity:1;transition:opacity .2s ease-out,transform .2s ease-out}.cesium-baseLayerPicker-sectionTitle{display:block;font-family:sans-serif;font-size:16pt;text-align:left;color:#edffff;margin-bottom:4px}.cesium-baseLayerPicker-choices{margin-bottom:5px}.cesium-baseLayerPicker-categoryTitle{color:#edffff;font-size:11pt}.cesium-baseLayerPicker-choices{display:block;border:1px solid #888;border-radius:5px;padding:5px 0}.cesium-baseLayerPicker-item{display:inline-block;vertical-align:top;margin:2px 5px;width:64px;text-align:center;cursor:pointer}.cesium-baseLayerPicker-itemLabel{display:block;font-family:sans-serif;font-size:8pt;text-align:center;vertical-align:middle;color:#edffff;cursor:pointer;word-wrap:break-word}.cesium-baseLayerPicker-item:focus .cesium-baseLayerPicker-itemLabel,.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemLabel{text-decoration:underline}.cesium-baseLayerPicker-itemIcon{display:inline-block;position:relative;width:inherit;height:auto;background-size:100% 100%;border:solid 1px #444;border-radius:9px;color:#edffff;margin:0;padding:0;cursor:pointer;box-sizing:border-box}.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon{border-color:#fff;box-shadow:0 0 8px #fff,0 0 8px #fff}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemLabel{color:#bdecf8}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemIcon{border:double 4px #bdecf8}.cesium-widget{position:relative}.cesium-widget,.cesium-widget canvas{width:100%;height:100%;touch-action:none}.cesium-widget-credits{display:block;position:absolute;bottom:0;left:0;color:#fff;font-size:10px;text-shadow:0 0 2px #000;padding-right:5px}.cesium-widget-credits a,.cesium-widget-credits a:visited{color:#fff}.cesium-widget-errorPanel{position:absolute;top:0;right:0;bottom:0;left:0;text-align:center;background:rgba(0,0,0,.7);z-index:99999}.cesium-widget-errorPanel:before{display:inline-block;vertical-align:middle;height:100%;content:\"\"}.cesium-widget-errorPanel-content{width:75%;display:inline-block;text-align:left;vertical-align:middle;border:1px solid #526f82;border-radius:7px;background-color:#000;color:#fff;font-size:10pt;padding:1em}.cesium-widget-errorPanel-header{font-size:120%;color:#fe4}.cesium-widget-errorPanel-scroll{overflow:auto;font-family:monospace;white-space:pre-wrap;padding:0;margin:10px 0}.cesium-widget-errorPanel-buttonPanel{text-align:center}.cesium-cesiumInspector{border-radius:5px;transition:width ease-in-out .25s;background:rgba(48,51,54,.8);border:1px solid #444;color:#edffff;display:inline-block;position:relative;padding:4px 12px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden}.cesium-cesiumInspector-button{text-align:center;font-size:11pt}.cesium-cesiumInspector-visible .cesium-cesiumInspector-button{border-bottom:1px solid #aaa;padding-bottom:3px}.cesium-cesiumInspector input:enabled,.cesium-cesiumInspector-button{cursor:pointer}.cesium-cesiumInspector-visible{width:185px;height:auto}.cesium-cesiumInspector-hidden{width:122px;height:17px}.cesium-cesiumInspector-sectionContent{max-height:500px}.cesium-cesiumInspector-section-collapsed .cesium-cesiumInspector-sectionContent{max-height:0;padding:0!important;overflow:hidden}.cesium-cesiumInspector-dropDown{margin:5px 0;font-family:sans-serif;font-size:10pt;width:185px}.cesium-cesiumInspector-frustumStatistics{padding-left:10px;padding:5px;background-color:rgba(80,80,80,.75)}.cesium-cesiumInspector-pickButton{background-color:rgba(0,0,0,.3);border:1px solid #444;color:#edffff;border-radius:5px;padding:3px 7px;cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;margin:0 auto}.cesium-cesiumInspector-pickButton:focus{outline:0}.cesium-cesiumInspector-pickButton:active,.cesium-cesiumInspector-pickButtonHighlight{color:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff}.cesium-cesiumInspector-center{text-align:center}.cesium-cesiumInspector-sectionHeader{font-weight:700;font-size:10pt;margin:0;cursor:pointer}.cesium-cesiumInspector-pickSection{border:1px solid #aaa;border-radius:5px;padding:3px;margin-bottom:5px}.cesium-cesiumInspector-sectionContent{margin-bottom:10px;transition:max-height .25s}.cesium-cesiumInspector-tileText{padding-bottom:10px;border-bottom:1px solid #aaa}.cesium-cesiumInspector-relativeText{padding-top:10px}.cesium-cesiumInspector-sectionHeader::before{margin-right:5px;content:'-';width:1ch;display:inline-block}.cesium-cesiumInspector-section-collapsed .cesium-cesiumInspector-sectionHeader::before{content:'+'}ul.cesium-cesiumInspector-statistics{margin:0;padding-top:3px;padding-bottom:3px}ul.cesium-cesiumInspector-statistics+ul.cesium-cesiumInspector-statistics{border-top:1px solid #aaa}.cesium-cesiumInspector-slider{margin-top:5px}.cesium-cesiumInspector-slider input[type=number]{text-align:left;background-color:#222;outline:0;border:1px solid #444;color:#edffff;width:100px;border-radius:3px;padding:1px;margin-left:10px;cursor:auto}.cesium-cesiumInspector-slider input[type=number]::-webkit-inner-spin-button,.cesium-cesiumInspector-slider input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.cesium-cesiumInspector-slider input[type=range]{margin-left:5px;vertical-align:middle}.cesium-cesiumInspector-hide .cesium-cesiumInspector-styleEditor{display:none}.cesium-cesiumInspector-styleEditor{padding:10px;border-radius:5px;background:rgba(48,51,54,.8);border:1px solid #444}.cesium-cesiumInspector-styleEditor textarea{width:100%;height:300px;background:0 0;color:#edffff;border:none;padding:0;white-space:pre;overflow-wrap:normal;overflow-x:auto}.cesium-3DTilesInspector{width:300px;pointer-events:all}.cesium-3DTilesInspector-statistics{font-size:11px}.cesium-3DTilesInspector div,.cesium-3DTilesInspector input[type=range]{width:100%;box-sizing:border-box}.cesium-cesiumInspector-error{color:#ff9e9e;overflow:auto}.cesium-3DTilesInspector .cesium-cesiumInspector-section{margin-top:3px}.cesium-3DTilesInspector .cesium-cesiumInspector-sectionHeader+.cesium-cesiumInspector-show{border-top:1px solid #fff}input.cesium-cesiumInspector-url{overflow:hidden;white-space:nowrap;overflow-x:scroll;background-color:transparent;color:#fff;outline:0;border:none;height:1em;width:100%}.cesium-cesiumInspector .field-group{display:table}.cesium-cesiumInspector .field-group>label{display:table-cell;font-weight:700}.cesium-cesiumInspector .field-group>.field{display:table-cell;width:100%}.cesium-button.cesium-fullscreenButton{display:block;width:100%;height:100%;margin:0;border-radius:0}.cesium-button.cesium-vrButton{display:block;width:100%;height:100%;margin:0;border-radius:0}.cesium-viewer-geocoderContainer .cesium-geocoder-input{border:solid 1px #444;background-color:rgba(40,40,40,.7);color:#fff;display:inline-block;vertical-align:middle;width:0;height:32px;margin:0;padding:0 32px 0 0;border-radius:0;box-sizing:border-box;transition:width ease-in-out .25s,background-color .2s ease-in-out;-webkit-appearance:none}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input{border-color:#aef;box-shadow:0 0 8px #fff}.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus{border-color:#ea4;background-color:rgba(15,15,15,.9);box-shadow:none;outline:0}.cesium-viewer-geocoderContainer .cesium-geocoder-input-wide,.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus,.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input{padding-left:4px;width:250px}.cesium-viewer-geocoderContainer .search-results{position:absolute;background-color:#000;color:#eee;overflow-y:auto;opacity:.8;width:100%}.cesium-viewer-geocoderContainer .search-results ul{list-style-type:none;margin:0;padding:0}.cesium-viewer-geocoderContainer .search-results ul li{font-size:14px;padding:3px 10px}.cesium-viewer-geocoderContainer .search-results ul li:hover{cursor:pointer}.cesium-viewer-geocoderContainer .search-results ul li.active{background:#48b}.cesium-geocoder-searchButton{background-color:#303336;display:inline-block;position:absolute;cursor:pointer;width:32px;top:1px;right:1px;height:30px;vertical-align:middle;fill:#edffff}.cesium-geocoder-searchButton:hover{background-color:#48b}.cesium-infoBox{display:block;position:absolute;top:50px;right:0;width:40%;max-width:480px;background:rgba(38,38,38,.95);color:#edffff;border:1px solid #444;border-right:none;border-top-left-radius:7px;border-bottom-left-radius:7px;box-shadow:0 0 10px 1px #000;transform:translate(100%,0);visibility:hidden;opacity:0;transition:visibility 0s .2s,opacity .2s ease-in,transform .2s ease-in}.cesium-infoBox-visible{transform:translate(0,0);visibility:visible;opacity:1;transition:opacity .2s ease-out,transform .2s ease-out}.cesium-infoBox-title{display:block;height:20px;padding:5px 30px 5px 25px;background:rgba(84,84,84,1);border-top-left-radius:7px;text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;box-sizing:content-box}.cesium-infoBox-bodyless .cesium-infoBox-title{border-bottom-left-radius:7px}button.cesium-infoBox-camera{display:block;position:absolute;top:4px;left:4px;width:22px;height:22px;background:0 0;border-color:transparent;border-radius:3px;padding:0 5px;margin:0}button.cesium-infoBox-close{display:block;position:absolute;top:5px;right:5px;height:20px;background:0 0;border:none;border-radius:2px;font-weight:700;font-size:16px;padding:0 5px;margin:0;color:#edffff}button.cesium-infoBox-close:focus{background:rgba(238,136,0,.44);outline:0}button.cesium-infoBox-close:hover{background:#888;color:#000}button.cesium-infoBox-close:active{background:#a00;color:#000}.cesium-infoBox-bodyless .cesium-infoBox-iframe{display:none}.cesium-infoBox-iframe{border:none;width:100%;width:calc(100% - 2px)}span.cesium-sceneModePicker-wrapper{display:inline-block;position:relative;margin:0 3px}.cesium-sceneModePicker-visible{visibility:visible;opacity:1;transition:opacity .25s linear}.cesium-sceneModePicker-hidden{visibility:hidden;opacity:0;transition:visibility 0s .25s,opacity .25s linear}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-none{display:none}.cesium-sceneModePicker-slide-svg{transition:left 2s;top:0;left:0}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-dropDown-icon{box-sizing:border-box;padding:0;margin:3px 0}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView{margin:0 0 3px 0}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-icon2D{left:100%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-iconColumbusView{left:200%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon3D{left:-200%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon2D{left:-100%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-icon3D{left:-100%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-iconColumbusView{left:100%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-selected{border-color:#2e2;box-shadow:0 0 8px #fff,0 0 8px #fff}span.cesium-projectionPicker-wrapper{display:inline-block;position:relative;margin:0 3px}.cesium-projectionPicker-visible{visibility:visible;opacity:1;transition:opacity .25s linear}.cesium-projectionPicker-hidden{visibility:hidden;opacity:0;transition:visibility 0s .25s,opacity .25s linear}.cesium-projectionPicker-wrapper .cesium-projectionPicker-none{display:none}.cesium-projectionPicker-wrapper .cesium-projectionPicker-dropDown-icon{box-sizing:border-box;padding:0;margin:3px 0}.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonOrthographic,.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonPerspective{margin:0 0 3px 0}.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonPerspective .cesium-projectionPicker-iconOrthographic{left:100%}.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonOrthographic .cesium-projectionPicker-iconPerspective{left:-100%}.cesium-projectionPicker-wrapper .cesium-projectionPicker-selected{border-color:#2e2;box-shadow:0 0 8px #fff,0 0 8px #fff}.cesium-performance-watchdog-message-area{position:relative;background-color:#ff0;color:#000;padding:10px}.cesium-performance-watchdog-message{margin-right:30px}.cesium-performance-watchdog-message-dismiss{position:absolute;right:0;margin:0 10px 0 0}.cesium-navigationHelpButton-wrapper{position:relative;display:inline-block}.cesium-navigation-help{visibility:hidden;position:absolute;top:38px;right:2px;width:250px;border-radius:10px;transform:scale(.01);transform-origin:234px -10px;transition:visibility 0s .25s,transform .25s ease-in}.cesium-navigation-help-visible{visibility:visible;transform:scale(1);transition:transform .25s ease-out}.cesium-navigation-help-instructions{border:1px solid #444;background-color:rgba(38,38,38,.75);padding-bottom:5px;border-radius:0 0 10px 10px}.cesium-click-navigation-help{display:none}.cesium-touch-navigation-help{display:none;padding-top:5px}.cesium-click-navigation-help-visible{display:block}.cesium-touch-navigation-help-visible{display:block}.cesium-navigation-help-pan{color:#6cf;font-weight:700}.cesium-navigation-help-zoom{color:#65fd00;font-weight:700}.cesium-navigation-help-rotate{color:#ffd800;font-weight:700}.cesium-navigation-help-tilt{color:#d800d8;font-weight:700}.cesium-navigation-help-details{color:#fff}.cesium-navigation-button{color:#fff;background-color:transparent;border-bottom:none;border-top:1px solid #444;border-right:1px solid #444;margin:0;width:50%;cursor:pointer}.cesium-navigation-button-icon{vertical-align:middle;padding:5px 1px}.cesium-navigation-button:focus{outline:0}.cesium-navigation-button-left{border-radius:10px 0 0 0;border-left:1px solid #444}.cesium-navigation-button-right{border-radius:0 10px 0 0;border-left:none}.cesium-navigation-button-selected{background-color:rgba(38,38,38,.75)}.cesium-navigation-button-unselected{background-color:rgba(0,0,0,.75)}.cesium-navigation-button-unselected:hover{background-color:rgba(76,76,76,.75)}.cesium-selection-wrapper{position:absolute;width:160px;height:160px;pointer-events:none;visibility:hidden;opacity:0;transition:visibility 0s .2s,opacity .2s ease-in}.cesium-selection-wrapper-visible{visibility:visible;opacity:1;transition:opacity .2s ease-out}.cesium-selection-wrapper svg{fill:#2e2;stroke:#000;stroke-width:1.1px}.cesium-selection-wrapper .cesium-selection-circle{opacity:.9}.cesium-timeline-main{position:relative;left:0;bottom:0;overflow:hidden;border:solid 1px #888}.cesium-timeline-trackContainer{width:100%;overflow:auto;border-top:solid 1px #888;position:relative;top:0;left:0}.cesium-timeline-tracks{position:absolute;top:0;left:0;width:100%}.cesium-timeline-needle{position:absolute;left:0;top:1.7em;bottom:0;width:1px;background:red}.cesium-timeline-bar{position:relative;left:0;top:0;overflow:hidden;cursor:pointer;width:100%;height:1.7em;background:linear-gradient(to bottom,rgba(116,117,119,.8) 0,rgba(58,68,82,.8) 11%,rgba(46,50,56,.8) 46%,rgba(53,53,53,.8) 81%,rgba(53,53,53,.8) 100%)}.cesium-timeline-ruler{visibility:hidden;white-space:nowrap;font-size:80%;z-index:-200}.cesium-timeline-highlight{position:absolute;bottom:0;left:0;background:#08f}.cesium-timeline-ticLabel{position:absolute;top:0;left:0;white-space:nowrap;font-size:80%;color:#eee}.cesium-timeline-ticMain{position:absolute;bottom:0;left:0;width:1px;height:50%;background:#eee}.cesium-timeline-ticSub{position:absolute;bottom:0;left:0;width:1px;height:33%;background:#aaa}.cesium-timeline-ticTiny{position:absolute;bottom:0;left:0;width:1px;height:25%;background:#888}.cesium-timeline-icon16{display:block;position:absolute;width:16px;height:16px;background-image:url(Images/TimelineIcons.png);background-repeat:no-repeat}.cesium-viewer{font-family:sans-serif;font-size:16px;overflow:hidden;display:block;position:relative;top:0;left:0;width:100%;height:100%}.cesium-viewer-cesiumWidgetContainer{width:100%;height:100%}.cesium-viewer-bottom{display:block;position:absolute;bottom:0;left:0;right:0;padding-right:5px}.cesium-viewer .cesium-widget-credits{display:inline;position:static;bottom:auto;left:auto;padding-right:0;color:#fff;font-size:10px;text-shadow:0 0 2px #000}.cesium-viewer-timelineContainer{position:absolute;bottom:0;left:169px;right:29px;height:27px;padding:0;margin:0;overflow:hidden;font-size:14px}.cesium-viewer-animationContainer{position:absolute;bottom:0;left:0;padding:0;width:169px;height:112px}.cesium-viewer-fullscreenContainer{position:absolute;bottom:0;right:0;padding:0;width:29px;height:29px;overflow:hidden}.cesium-viewer-vrContainer{position:absolute;bottom:0;right:0;padding:0;width:29px;height:29px;overflow:hidden}.cesium-viewer-toolbar{display:block;position:absolute;top:5px;right:5px}.cesium-viewer-cesiumInspectorContainer{display:block;position:absolute;top:50px;right:10px}.cesium-viewer-measureContainer{position:relative;display:inline-block;margin:0 3px;vertical-align:middle}.cesium-viewer-geocoderContainer{position:relative;display:inline-block;margin:0 3px}.cesium-viewer-cesium3DTilesInspectorContainer{display:block;position:absolute;top:50px;right:10px;max-height:calc(100% - 120px);box-sizing:border-box;overflow-y:auto;overflow-x:hidden}.cesium-measure-toolbar{width:40px;height:32px;overflow:hidden;transition:width .8s;white-space:nowrap;background:#303336;border:1px solid #444;color:#edffff;stroke:#edffff;stroke-width:2;fill:transparent}.cesium-measure-toolbar.expanded{width:423px}.cesium-measure-button{vertical-align:top;display:inline-block;border-right:1px solid #444;cursor:pointer;padding:4px 8px;height:25px;width:25px;margin-left:-4px}.cesium-measure-button:first-child{margin-left:0}.cesium-measure-button:hover{background-color:#48b}.cesium-measure-button:last-child{border-right:none}.cesium-measure-button.active{background-color:#1a71cc;cursor:default}.cesium-measure-button-main{stroke-width:1.3}.cesium-measure-help{stroke-width:0;padding:6px 8px;fill:#edffff}.cesium-measure-instructions{position:absolute;max-height:500px;width:403px;border:1px solid #444;overflow-y:auto;border-radius:0;background-color:rgba(48,51,54,.8);color:#edffff;padding:10px;stroke:#edffff;stroke-width:2}.cesium-measure-icon{margin-right:10px}.cesium-measure-instructions .bold{margin-bottom:3px}.cesium-measure-instructions>ul{padding-left:20px}.transform-editor-menu{position:absolute;stroke:none;fill:#edffff}.transform-editor-button{padding:0;width:25px;height:25px;border-radius:13px}.transform-editor-button>svg{margin-top:2px;margin-left:2px}.transform-editor-options{position:relative;left:-16px;background-color:#303336;color:#edffff}.transform-editor-button-row>div{display:inline-block;cursor:pointer;padding-top:4px;padding-left:4px;width:30px;height:30px;border:1px solid #444}.transform-editor-button-row>div.selected{background-color:#1e90ff}.transform-editor-button-row>div:hover{background-color:#48b}")}`, ee`${Q(".cesium-theme * {\n    box-sizing: content-box;\n}\n\n.cesium-theme .cesium-button.cesium-fullscreenButton {\n    box-sizing: border-box;\n}\n\n.cesium-theme .cesium-timeline-main {\n    border: none;\n}\n\n.cesium-theme .cesium-timeline-bar {\n    background: var(--transparent-widget-color);\n    height: 29px;\n}\n\n.cesium-theme .cesium-timeline-ticLabel {\n    color: var(--text-light);\n}\n\n.cesium-theme .cesium-timeline-ticMain {\n    position: absolute;\n    bottom: 0;\n    left: 0;\n    width: 1px;\n    height: 50%;\n    background: var(--gray-lightest);\n}\n\n.cesium-theme .cesium-timeline-ticSub, .cesium-theme .cesium-timeline-ticTiny {\n    background: var(--gray-light);\n}\n\n.ion-editor.cesium-theme .cesium-viewer-timelineContainer {\n    height: 40px;\n}\n\n.cesium-theme .cesium-viewer-geocoderContainer {\n    font-family: var(--font-family);\n    font-size: var(--font-size);\n}\n\n.cesium-theme .cesium-viewer-geocoderContainer .search-results {\n    background-color: var(--transparent-widget-color);\n    border: 1px solid var(--gray-dark);\n    border-top: 0;\n    color: var(--text-light);\n    opacity: 1;\n    z-index: 2;\n}\n\n.cesium-theme .cesium-viewer-geocoderContainer .search-results ul li {\n    font-size: var(--font-size);\n}\n\n.cesium-theme .cesium-geocoder-input {\n    background-color: var(--transparent-widget-color);\n    border: 1px solid var(--brand-dark-shade);\n    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n    -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;\n    -o-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;\n    transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s, width ease-in-out 0.25s, background-color 0.2s ease-in-out;\n}\n\n.cesium-theme .cesium-geocoder-input::placeholder {\n    color: var(--gray-light);\n  }\n\n.cesium-theme .cesium-geocoder-input:focus {\n    background-color: var(--gray-dark);\n    color: var(--text-light);\n    border-color: var(--brand-primary);\n    outline: 0;\n}\n\n.cesium-theme .cesium-geocoder-searchButton {\n    background-color: var(--brand-dark);\n    border: none;\n    fill: var(--text-light);\n    color: var(--text-light);\n}\n\n.cesium-theme .cesium-geocoder-searchButton:hover {\n    background-color: var(--brand-primary);\n}\n\n.cesium-theme .cesium-viewer-geocoderContainer:hover .cesium-geocoder-input {\n    box-shadow: none;\n    border: none;\n}\n\n.cesium-theme .cesium-viewer-geocoderContainer:hover .cesium-geocoder-input:focus {\n    background-color: var(--brand-dark);\n    color: var(--text-light);\n    border-color: var(--brand-dark-shade);\n    outline: 0;\n}\n\n.cesium-theme .cesium-button {\n    display: inline-block;\n    margin-bottom: 0;\n    font-weight: normal;\n    text-align: center;\n    white-space: nowrap;\n    vertical-align: middle;\n    touch-action: manipulation;\n    cursor: pointer;\n    background-image: none;\n    border: 1px solid transparent;\n    padding: 6px 12px;\n    font-size: 14px;\n    line-height: 1.35;\n    border-radius: 5px;\n    -webkit-user-select: none;\n    -moz-user-select: none;\n    -ms-user-select: none;\n    user-select: none;\n    color: #fff;\n    fill: #fff;\n    background-color: var(--brand-dark);\n    border-color: var(--brand-dark-shade);\n    border-radius: 0;\n}\n\n.cesium-theme .cesium-button:hover {\n    background-color: var(--brand-primary);\n    border-color: var(--brand-primary-shade);\n}\n\n.cesium-theme .cesium-widget-credits {\n    position: initial;\n    display: inline-block;\n    text-shadow: none;\n}\n\n.cesium-theme .cesium-credit-logoContainer img {\n    height: 25px;\n    padding-top: 2px;\n    vertical-align: bottom;\n}\n\n.cesium-theme .cesium-button:active {\n    fill: var(--text-light);\n}\n\n.cesium-theme #mapViewerCredits .cesium-credit-text {\n    color: var(--text-light);\n}\n\n.cesium-theme .cesium-credit-expand-link {\n    padding-left: 5px;\n    cursor: pointer;\n    text-decoration: underline;\n    color: var(--text-light);\n}\n.cesium-theme .cesium-credit-expand-link:hover {\n    color: var(--brand-primary);\n}\n.cesium-theme .cesium-credit-text {\n    color: var(--text-light);\n}\n.cesium-theme .cesium-credit-textContainer *,\n.cesium-theme .cesium-credit-logoContainer * {\n    display: inline;\n}\n\n.cesium-theme .cesium-credit-lightbox-overlay {\n    z-index: 2;\n    background-color: var(--transparent-overlay-color);\n    display: none;\n    position: absolute;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 100%;\n}\n.cesium-theme .cesium-credit-lightbox {\n    background-color: var(--brand-dark);\n    color: var(--text-light);\n    font-family: var(--font-family);\n    font-size: var(--font-size);\n    border: none;\n    border-radius: var(--border-radius);\n    position: relative;\n    min-height: 100px;\n    margin: auto;\n}\n\n.cesium-theme .cesium-credit-lightbox > ul > li a, .cesium-theme .cesium-credit-lightbox > ul > li a:visited {\n    color: var(--text-light);\n}\n.cesium-theme .cesium-credit-lightbox > ul > li a:hover {\n    color: var(--brand-primary);\n}\n.cesium-theme .cesium-credit-lightbox-close {\n    color: var(--text-light);\n    font-weight: bold;\n    font-size: 18pt;\n    cursor: pointer;\n    position: absolute;\n    top: 0;\n    right: 6px;\n}\n.cesium-theme .cesium-credit-lightbox-close:hover {\n    color: var(--brand-primary);\n}\n.cesium-credit-lightbox.cesium-credit-lightbox-expanded {\n    border: 1px solid var(--brand-dark-shade);\n    border-radius: 5px;\n    max-width: 370px;\n}\n.cesium-credit-lightbox.cesium-credit-lightbox-mobile {\n    height: 100%;\n    width: 100%;\n}\n.cesium-theme .cesium-credit-lightbox.cesium-credit-lightbox-mobile {\n    border-radius: 0;\n}\n.cesium-theme .cesium-credit-lightbox-title {\n    padding: 20px 20px 0 20px;\n}\n.cesium-theme .cesium-credit-lightbox > ul {\n    margin: 0;\n    padding: 12px 20px 12px 40px;\n    font-size: 13px;\n}\n.cesium-theme .cesium-credit-lightbox > ul > li {\n    padding-bottom: 6px;\n}\n.cesium-theme .cesium-credit-lightbox > ul > li * {\n    padding: 0;\n    margin: 0;\n}\n.cesium-theme .cesium-credit-text {\n    color: var(--text-light);\n}\n\n.cesium-theme .cesium-measure-toolbar {\n    height: 43px;\n    color: #fff;\n    stroke: #fff;\n    border-radius: var(--border-radius);\n    background-color: var(--brand-dark);\n    border: none;\n}\n.cesium-theme .cesium-measure-toolbar.expanded {\n    width: 373px;\n}\n.cesium-theme .cesium-viewer-measureContainer {\n    vertical-align: bottom;\n}\n.cesium-theme .cesium-measure-toolbar .cesium-measure-button {\n    padding: 9px 8px;\n}\n.cesium-theme .cesium-measure-toolbar .cesium-measure-button > svg {\n    height: 23px;\n    width: 23px;\n}\n.cesium-theme .cesium-measure-toolbar .cesium-measure-help {\n    display: none;\n}\n\n.cesium-theme .cesium-measure-toolbar .cesium-measure-button.active {\n    background-color: var(--brand-primary);\n    stroke: var(--text-light);\n}\n\n.cesium-theme .cesium-measure-toolbar .cesium-measure-help.active {\n    background-color: var(--brand-primary);\n    fill: var(--text-light);\n}\n\n.cesium-theme .cesium-measure-toolbar .cesium-measure-button:hover {\n    background-color: var(--brand-primary);\n}\n\n.cesium-theme .cesium-measure-instructions {\n    background-color: var(--brand-dark);\n    color: var(--text-light);\n    stroke: var(--text-light);\n    fill: transparent;\n}\n\n.cesium-theme .cesium-button.transform-editor-button {\n    border-radius: 100%;\n    padding: 5px;\n}\n\n.cesium-viewer-timelineContainer {\n    -webkit-user-select: none;\n    -moz-user-select: none;\n    -ms-user-select: none;\n    user-select: none;\n}\n\n.cesium-timeline-needle {\n    top: 0;\n    width: 2px;\n    background-color: var(--brand-primary);\n}\n\n.cesium-timeline-icon16 {\n    background-image: '';\n}\n")}`];
    customElements.define("cesium-popover", class extends ie {
        static get properties() {
            return {
                _open: {type: Boolean, reflect: !0},
                direction: {type: String, reflect: !0},
                anchor: {type: String},
                dock: {type: String}
            }
        }

        static get styles() {
            return [Ri, ee`:host{display:none;z-index:10;position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none}.popover-wrapper{background-color:var(--container-bg);border-radius:var(--border-radius);position:absolute;box-shadow:0 0 10px var(--shadow-color);max-height:90%;overflow-y:auto}:host([_open]){display:inline-block}:host([_open]) .popover-wrapper{pointer-events:all}`]
        }

        constructor() {
            super(), this._open = !1, this.direction = "down", this.dock = "left", this.top = 0, this.left = 0, this._updatePosition = this._updatePosition.bind(this), this._closeDropdown = this._closeDropdown.bind(this)
        }

        connectedCallback() {
            super.connectedCallback(), window.addEventListener("resize", this._updatePosition)
        }

        disconnectedCallback() {
            super.disconnectedCallback(), document.removeEventListener("pointerdown", this._closeDropdown), window.removeEventListener("resize", this._updatePosition)
        }

        firstUpdated() {
            this.addEventListener("click", e => {
                e.stopPropagation()
            }), this.addEventListener("pointerdown", e => {
                e.stopPropagation()
            }), this.addEventListener("pointerup", e => {
                e.stopPropagation()
            })
        }

        render() {
            const e = `top: ${this.top}px; left: ${this.left}px`;
            return z`<div class="popover-wrapper" style="${e}"><slot></slot></div>`
        }

        updated() {
            this._open && this.updateComplete.then(() => {
                this._updatePosition()
            })
        }

        _closeDropdown(t) {
            e.defined(t) && -1 !== t.composedPath().indexOf(this) || this.close()
        }

        open() {
            this._open = !0, document.addEventListener("pointerdown", this._closeDropdown), document.addEventListener("wheel", this._closeDropdown)
        }

        close() {
            this._open = !1, document.removeEventListener("pointerdown", this._closeDropdown), document.removeEventListener("wheel", this._closeDropdown)
        }

        _updatePosition() {
            const t = this.anchor, i = this.shadowRoot.host.getRootNode().querySelector(t);
            if (!e.defined(i)) return this.top = 0, void (this.left = 0);
            const n = i.getBoundingClientRect(),
                o = this.shadowRoot.querySelector(".popover-wrapper").getBoundingClientRect();
            let r = n.left, a = n.top;
            const s = n.width, c = n.height, l = o.width, d = o.height;
            switch ("left" !== this.dock && (r = r + s - l), r + l > window.innerWidth && (r = window.innerWidth - l), this.direction) {
                case"down":
                    a += c + 5;
                    break;
                case"up":
                    a -= d + 5;
                    break;
                case"right":
                    r += s + 5;
                    break;
                case"left":
                    r -= l + 5
            }
            a === this.top && r === this.left || (this.top = a, this.left = r, this.requestUpdate())
        }
    });

    function ko(t, i, n, o) {
        e.defined(i.aspectRatio) ? i.aspectRatio = o / n : (i.top = i.right * (n / o), i.bottom = -i.top), t.height = n, t.width = o
    }

    window.customElements.define("ion-play-button", class extends ie {
        static get styles() {
            return [Ri, ee`:host{display:inline-block}ion-button{--border-radius:0;--button-padding:0}ion-button #icon{width:27px;height:27px;padding-top:7px}ion-button svg{height:14px;width:14px}`]
        }

        static get properties() {
            return {isPlaying: {type: Boolean, reflect: !0}}
        }

        constructor() {
            super(), this.isPlaying = !1, this._clockViewModel = void 0, this._subscription = void 0
        }

        disconnectedCallback() {
            this._subscription && this._subscription.dispose()
        }

        get clockViewModel() {
            return this._clockViewModel
        }

        set clockViewModel(t) {
            this._clockViewModel = t, this._subscription = e.knockout.getObservable(t, "shouldAnimate").subscribe(e => {
                this.isPlaying = e
            })
        }

        _toggle() {
            this.dispatchEvent(new CustomEvent("click", {detail: {value: !this._clockViewModel.shouldAnimate}})), this._clockViewModel.shouldAnimate = !this._clockViewModel.shouldAnimate
        }

        render() {
            return z`<ion-button theme="dark" @click="${this._toggle}" title="${this.isPlaying ? "Pause animation" : "Play animation"}"><div id="icon">${this.isPlaying ? ki.node : xi.node}</div></ion-button>`
        }
    });
    window.customElements.define("ion-map-viewer", class extends ie {
        static get styles() {
            return [Ri, xo, ee`:host{position:relative}:host([timelineVisible]) .cesium-viewer-timelineContainer{display:inherit}.cesium-viewer-timelineContainer{display:none;height:28px;border-bottom:1px solid var(--gray-light)}#cesiumContainer,#mapContainer{overflow:hidden;position:absolute;height:100%;width:100%}#bottomBar{padding-left:.5rem;position:absolute;height:29px;width:100%;bottom:0;background-color:var(--transparent-widget-color);z-index:1;color:var(--text-light)}#scaleCoordinateContainer{text-align:right;float:right;height:100%;overflow:hidden}:host([supportsFullscreen]) #bottomBar{width:calc(100% - 29px)}#creditContainer{display:inline-block}cesium-map-scale{position:relative;font-size:var(--font-size-small);vertical-align:top}cesium-coordinates{background-color:transparent;font-size:var(--font-size-small);padding:0;padding-top:5px}ion-loading-icon{width:1rem;height:1rem;vertical-align:baseline;margin:0 .5rem;color:var(--text-light);pointer-events:none}ion-loading-icon{display:inline-block}cesium-navigation{--widgets-background-color:var(--brand-dark);--widgets-alt-background-color:var(--brand-dark);display:none;position:absolute;top:55px;right:0;z-index:1}ion-play-button{position:absolute;bottom:29px;left:0;width:29px;height:29px}ion-play-button.ion-editor{height:40px;background-color:var(--transparent-widget-color)}.cesium-theme .cesium-viewer-toolbar{top:10px;right:10px}#measureContainer{display:none;position:absolute;bottom:3.25rem;left:1rem;z-index:2}#measureContainer *{box-sizing:content-box}.timeline-trim-needle{box-sizing:content-box;bottom:27px;position:absolute;width:15px;height:15px;background-color:var(--gray-lighter);border:1px solid var(--gray-light);border-radius:50%;cursor:grab;z-index:1}.timeline-trim-needle:hover{background-color:var(--brand-primary-tint)}:host([timelineVisible]) #measureContainer{bottom:5.25rem}:host([isviewer]) #measureContainer{left:219px}:host([timelineVisible][isviewer]) #measureContainer{bottom:5.25rem}:host([isviewer]) cesium-navigation{top:10px}:host([widgetshidden]) .cesium-viewer-toolbar{display:none}:host([widgetshidden]) #measureContainer{display:none}#currentTime{font-size:var(--font-size-small);padding-top:5px;display:none}@media (min-width:768px){cesium-navigation{display:block}#measureContainer{display:block}#currentTime{display:inline-block}}#inspectorContainer{position:absolute;top:50px;right:100px}#inspectorContainer label{color:var(--text-light)}.cesium-cesiumInspector-visible{box-sizing:content-box}`]
        }

        static get properties() {
            return {
                widgetsHidden: {type: Boolean, reflect: !0},
                timelineVisible: {type: Boolean, reflect: !0},
                isViewer: {type: Boolean, reflect: !0},
                supportsFullscreen: {type: Boolean, reflect: !0},
                currentTimeString: {type: String}
            }
        }

        constructor() {
            super(), this.onKeyDown = this.onKeyDown.bind(this), this._lastActiveSlide = void 0, this._activeSlide = void 0, this._lastAssetState = void 0, this._assetState = void 0, this._assetInstances = new e.AssociativeArray, this._sceneComplete = !1, this._sceneCompleteChange = new e.Event, this._sceneCompleteTimeout = void 0, this._removePostRenderEvent = void 0, this._removePostUpdateEvent = void 0, this._removeRenderErrorEvent = void 0, this._ready = !1, this._viewer = void 0, this._measureWidget = void 0, this._coordinates = void 0, this._mapScale = void 0, this._unit = void 0, this._tilesetCollection = new e.PrimitiveCollection, this.isViewer = !1, this._isSlideShow = !1, this.timelineVisible = !1, this.widgetsHidden = !1, this.currentTimeString = "", this.timelineStart = e.Iso8601.MINIMUM_VALUE.clone(), this.timelineStop = e.Iso8601.MAXIMUM_VALUE.clone(), this._timelineTrack = void 0, this.supportsFullscreen = !1
        }

        get viewer() {
            return this._viewer
        }

        get cameraView() {
            if (!e.defined(this._viewer)) return {};
            const t = this._viewer.scene.camera;
            return {position: e.Cartesian3.clone(t.positionWC), heading: t.heading, pitch: t.pitch, roll: t.roll}
        }

        get activeSlide() {
            return this._activeSlide
        }

        set activeSlide(e) {
            this._activeSlide !== e && (this._activeSlide = e, this._updateActiveSlide())
        }

        get assetState() {
            return this._assetState
        }

        set assetState(e) {
            this._assetState !== e && (this._assetState = e, this._updateAssetInstances())
        }

        get unit() {
            return this._unit
        }

        set unit(e) {
            this._unit !== e && (this._unit = e, this._updateUnits())
        }

        get shouldAnimate() {
            return this._viewer.clockViewModel.shouldAnimate
        }

        set shouldAnimate(e) {
            this._viewer.clockViewModel.shouldAnimate = e
        }

        get isSlideShow() {
            return this._isSlideShow
        }

        set isSlideShow(e) {
            this._isSlideShow = e, this.updateClockRange()
        }

        updateClockRange() {
            let t = e.ClockRange.UNBOUNDED;
            this.isViewer && (t = this._isSlideShow ? e.ClockRange.CLAMPED : e.ClockRange.LOOP_STOP), this.viewer.clockViewModel.clockRange = t
        }

        connectedCallback() {
            super.connectedCallback(), this.addEventListener("pointermove", this._pointerMove), document.addEventListener("keydown", this.onKeyDown, !0)
        }

        disconnectedCallback() {
            document.removeEventListener("keydown", this.onKeyDown, !0), this.removeEventListener("pointermove", this._pointerMove), e.defined(this._removePostRenderEvent) && (this._removePostRenderEvent(), this._removePostRenderEvent = void 0), e.defined(this._removePostUpdateEvent) && (this._removePostUpdateEvent(), this._removePostUpdateEvent = void 0), e.defined(this._removeRenderErrorEvent) && (this._removeRenderErrorEvent(), this._removeRenderErrorEvent = void 0), super.disconnectedCallback()
        }

        getAssetInstance(e) {
            return this._assetInstances.get(e)
        }

        firstUpdated() {
            this.supportsFullscreen = e.Fullscreen.supportsFullscreen() && this.isViewer;
            const t = this.shadowRoot.querySelector("#cesiumContainer"), i = new e.Viewer(t, {
                showRenderLoopErrors: !1,
                animation: !1,
                baseLayerPicker: !1,
                homeButton: !1,
                infoBox: !1,
                selectionIndicator: !1,
                imageryProvider: !1,
                navigationHelpButton: !1,
                geocoder: !this.isViewer,
                scene3DOnly: !0,
                requestRenderMode: !0,
                fullscreenButton: this.supportsFullscreen,
                creditContainer: this.shadowRoot.querySelector("#creditContainer")
            });
            this.isViewer || (i.geocoder.viewModel.keepExpanded = !0), i.scene.light = new e.DirectionalLight({direction: new e.Cartesian3(1, 0, 0)}), i.scene.preRender.addEventListener((function (t) {
                const n = i.scene.light;
                n.direction = e.Cartesian3.clone(t.camera.directionWC, n.direction)
            })), i.scene.logarithmicDepthBuffer = !0, i.scene.camera.frustum.near = .1, i.scene.camera.frustum.far = 1e10, this.isViewer || this.createTimelineTrim(i), this._viewer = i, i.scene.globe.depthTestAgainstTerrain = !0, this._onViewerInitialized()
        }

        createTimelineTrim(t) {
            const i = this.shadowRoot.querySelector("#startNeedle");
            let n, o = !1;
            const r = this.shadowRoot.querySelector("#stopNeedle");
            let a, s = !1;
            document.addEventListener("pointerup", e => {
                o ? (o = !1, e.preventDefault(), n = void 0) : s && (s = !1, e.preventDefault(), a = void 0)
            }), i.addEventListener("pointerdown", t => {
                o = !0, t.preventDefault(), n = e.JulianDate.fromIso8601(this._activeSlide.startTime)
            }), document.addEventListener("pointermove", i => {
                if (o && e.defined(this._activeSlide)) {
                    const o = (i.clientX - t.timeline._topDiv.getBoundingClientRect().left) / (t.timeline._topDiv.clientWidth / t.timeline._timeBarSecondsSpan);
                    e.JulianDate.addSeconds(this.timelineStart, o, n);
                    const r = e.JulianDate.fromIso8601(this._activeSlide.stopTime);
                    e.JulianDate.lessThan(n, this.timelineStart) ? n = this.timelineStart.clone() : e.JulianDate.greaterThan(n, r) && (n = r), t.clock.currentTime = n.clone(), t.timeline.updateFromClock(), i.preventDefault(), i.stopPropagation(), this.dispatchEvent(new CustomEvent("timelineTrimChanged", {detail: {start: e.JulianDate.toIso8601(n)}}))
                } else if (s && e.defined(this._activeSlide)) {
                    const n = (i.clientX - t.timeline._topDiv.getBoundingClientRect().left) / (t.timeline._topDiv.clientWidth / t.timeline._timeBarSecondsSpan);
                    e.JulianDate.addSeconds(this.timelineStart, n, a);
                    const o = e.JulianDate.fromIso8601(this._activeSlide.startTime);
                    e.JulianDate.greaterThan(a, this.timelineStop) ? a = this.timelineStop.clone() : e.JulianDate.lessThan(a, o) && (a = o), t.clock.currentTime = a.clone(), t.timeline.updateFromClock(), i.preventDefault(), i.stopPropagation(), this.dispatchEvent(new CustomEvent("timelineTrimChanged", {detail: {stop: e.JulianDate.toIso8601(a)}}))
                }
            }), r.addEventListener("pointerdown", t => {
                s = !0, t.preventDefault(), a = e.JulianDate.fromIso8601(this._activeSlide.stopTime)
            })
        }

        render() {
            const e = this.isViewer ? "ion-viewer" : "ion-editor";
            return z`<div id="measureContainer" class="cesium-theme cesium-viewer-measureContainer"></div><div id="mapContainer"><div id="cesiumContainer" class="${e} cesium-theme"></div><div id="inspectorContainer"></div>><div id="bottomBar"><div id="creditContainer" class="cesium-theme"></div><ion-loading-icon ?centered="${!1}" ?visible="${!this._sceneComplete}"></ion-loading-icon><span id="currentTime" ?hidden="${!this.timelineVisible}">${this.currentTimeString}</span><div id="scaleCoordinateContainer"><cesium-coordinates></cesium-coordinates><cesium-map-scale></cesium-map-scale></div></div>${this.renderTrim()}<ion-play-button class="${e}" ?hidden="${!this.timelineVisible}" @click="${this._clickPlayButton}"></ion-play-button><cesium-navigation></cesium-navigation></div>`
        }

        renderTrim() {
            return this.isViewer ? z`` : z`<div id="startNeedle" class="timeline-trim-needle" ?hidden="${!this.timelineVisible}"></div><div id="stopNeedle" class="timeline-trim-needle" ?hidden="${!this.timelineVisible}"></div>`
        }

        _clickPlayButton(t) {
            if (!this.isViewer && t.detail.value) {
                const t = this.viewer.clock;
                (e.JulianDate.lessThan(t.currentTime, t.startTime) || e.JulianDate.greaterThanOrEquals(t.currentTime, t.stopTime)) && (e.JulianDate.clone(t.startTime, t.currentTime), t.tick())
            }
        }

        _pointerMove(t) {
            if (!e.defined(this._viewer)) return;
            const i = this._viewer.scene.canvas.getBoundingClientRect(), n = t.clientX - i.left, o = t.clientY - i.top,
                r = JSON.stringify({x: n, y: o});
            this._mapScale.setAttribute("pointerPosition", r), this._coordinates.setAttribute("pointerPosition", r)
        }

        _onViewerInitialized() {
            const t = this._viewer, i = this.shadowRoot.querySelector("cesium-map-scale"),
                n = this.shadowRoot.querySelector("cesium-coordinates"),
                o = this.shadowRoot.querySelector("cesium-navigation"),
                r = this.shadowRoot.querySelector("ion-play-button"), a = t.scene;
            t.cesiumWidget.screenSpaceEventHandler.removeInputAction(e.ScreenSpaceEventType.LEFT_CLICK), t.cesiumWidget.screenSpaceEventHandler.removeInputAction(e.ScreenSpaceEventType.LEFT_DOUBLE_CLICK), r.clockViewModel = t.clockViewModel;
            const s = e.JulianDate.toDate(t.clockViewModel.currentTime);
            this.currentTimeString = s.toLocaleString(), e.knockout.getObservable(t.clockViewModel, "currentTime").subscribe(t => {
                const i = e.JulianDate.toDate(t);
                this.currentTimeString = i.toLocaleString()
            }), i.scene = a, n.scene = a, o.attach(a, t.clock), a.primitives.add(this._tilesetCollection);
            const c = t.timeline.resize.bind(t.timeline);
            t.timeline.resize = () => {
                t.timeline.container.style.bottom = "29px", t.timeline.container.style.left = "29px", t.timeline.container.style.right = "0", c(), this.updateTimelineTrim()
            }, this._viewer = t, this._coordinates = n, this._mapScale = i;
            const l = new e.Measure({
                container: this.shadowRoot.querySelector("#measureContainer"),
                scene: a,
                units: this.units
            });
            this._measureWidget = l, this._removePostUpdateEvent = a.postUpdate.addEventListener((function () {
                const e = t._container.clientHeight - 125;
                l._dropdown.style.maxHeight = e + "px"
            })), this._removePostRenderEvent = a.postRender.addEventListener(() => {
                this._updateSceneComplete()
            }), this._removeRenderErrorEvent = a.renderError.addEventListener((e, t) => {
                this.dispatchEvent(new CustomEvent("viewerError", {detail: {error: t}}))
            }), this.isViewer || (this._timelineTrack = t.timeline.addTrack(new e.TimeInterval, 10, e.Color.fromBytes(43, 135, 196, 178), e.Color.fromBytes(45, 58, 66, 178))), this._ready = !0, this._updateAssetInstances(), this._updateUnits(), this._updateActiveSlide(), t.scene.camera.flyHome = () => {
                this.flyToSlide(this._activeSlide)
            }, this.viewer.clock.onTick.addEventListener(t => {
                (t.shouldAnimate || this.isViewer) && (t.multiplier < 0 && e.JulianDate.lessThanOrEquals(t.currentTime, t.startTime) ? (e.JulianDate.clone(t.stopTime, t.currentTime), t.shouldAnimate = !1, requestAnimationFrame(() => t.tick())) : t.multiplier > 0 && e.JulianDate.greaterThanOrEquals(t.currentTime, t.stopTime) && (e.JulianDate.clone(t.startTime, t.currentTime), t.shouldAnimate = !1, requestAnimationFrame(() => t.tick())))
            });
            const d = t.timeline._timeBarEle;
            d.removeEventListener("DOMMouseScroll", t.timeline._onMouseWheel), d.removeEventListener("mousewheel", t.timeline._onMouseWheel), d.removeEventListener("mousedown", t.timeline._onMouseDown), d.addEventListener("mousedown", e => {
                0 !== e.button ? e.preventDefault() : t.timeline._onMouseDown(e)
            }), document.removeEventListener("mousemove", t.timeline._onMouseMove), document.addEventListener("mousemove", e => {
                const i = t.timeline;
                if (1 === i._mouseMode) {
                    const t = e.clientX - i._topDiv.getBoundingClientRect().left;
                    if (t > 0 && t < i._topDiv.clientWidth) return void i._onMouseMove(e)
                }
            }), this.dispatchEvent(new CustomEvent("viewerInitialized"))
        }

        _updateSceneComplete() {
            const e = this._viewer, t = this._tilesetCollection, i = e.scene.globe._surface;
            let n = e.clockViewModel.canAnimate && i.tileProvider.ready && 0 === i._tileLoadQueueHigh.length && 0 === i._tileLoadQueueMedium.length && 0 === i._tileLoadQueueLow.length && 0 === i._debug.tilesWaitingForChildren;
            if (n) {
                const e = t.length;
                for (let i = 0; i < e; i++) {
                    if (n = t.get(i).tilesLoaded, !n) break
                }
            }
            n !== this._sceneComplete && (this._sceneComplete = n, clearTimeout(this._sceneCompleteTimeout), this._sceneCompleteTimeout = setTimeout(() => {
                this._sceneCompleteChange.raiseEvent(this._sceneComplete), this.requestUpdate()
            }, 100))
        }

        async _addAssetCesiumInstance(t) {
            if (t.status !== re.COMPLETE) return;
            let i;
            const n = this._viewer;
            let o;
            switch (t.type) {
                case se.IMAGERY:
                    o = new e.ImageryLayer(new e.IonImageryProvider({assetId: t.id})), n.scene.imageryLayers.add(o);
                    break;
                case se["3DTILES"]:
                    o = new e.Cesium3DTileset({url: e.IonResource.fromAssetId(t.id)}), o.pointCloudShading.attenuation = !0, o.pointCloudShading.eyeDomeLighting = !0, this._tilesetCollection.add(o);
                    break;
                case se.KML:
                case se.GEOJSON:
                case se.CZML:
                    o = t.type === se.KML ? new e.KmlDataSource({
                        camera: n.scene.camera,
                        canvas: n.scene.canvas
                    }) : t.type === se.GEOJSON ? new e.GeoJsonDataSource : new e.CzmlDataSource, n.dataSources.add(o), i = e.IonResource.fromAssetId(t.id).then(e => o.load(e, {clampToGround: !0}))
            }
            const r = this._activeSlide.assetSettings[t.id], a = !!e.defined(r) && r.show;
            return o.show = e.defaultValue(a, !1), this._assetInstances.set(t.id, o), i
        }

        _deleteCesiumAssetInstance(t) {
            const i = this._viewer, n = this._assetInstances.get(t);
            n instanceof e.ImageryLayer ? i.scene.imageryLayers.remove(n) : n instanceof e.Cesium3DTileset ? this._tilesetCollection.remove(n) : i.dataSources.remove(n), this._assetInstances.remove(t)
        }

        _updateAssetInstances() {
            if (!this._ready || this._assetState === this._lastAssetState) return;
            const e = [], t = this._assetState, i = this._assetInstances, n = Object.keys(i._hash).map(e => Number(e));
            n.sort((e, t) => e - t);
            const o = t.ids.slice(), r = t.byId;
            o.sort((e, t) => e - t);
            let a = 0, s = 0;
            for (; a < n.length && s < o.length;) {
                const t = n[a], i = o[s];
                i < t ? (e.push(this._addAssetCesiumInstance(r[i])), s++) : i === t ? (s++, a++) : (this._deleteCesiumAssetInstance(t), a++)
            }
            for (; s < o.length; s++) e.push(this._addAssetCesiumInstance(r[o[s]]));
            for (; a < n.length; a++) this._deleteCesiumAssetInstance(n[a]);
            this._lastAssetState = t, this._updateAssetOrder(), Promise.all(e).finally(() => {
                this._updateTimeline() && this.dispatchEvent(new CustomEvent("timelineChanged", {
                    detail: {
                        visible: this.timelineVisible,
                        start: this.timelineStart.clone(),
                        stop: this.timelineStop.clone()
                    }
                })), this.updateAnimation(this._activeSlide), this._viewer.clockViewModel.shouldAnimate = this.timelineVisible && this.isViewer
            })
        }

        _updateTimeline() {
            const t = this._viewer.dataSources;
            let i, n, o = !1;
            for (let r = 0; r < t.length; r++) {
                const a = t.get(r);
                e.defined(a.clock) && a.show && (o = !0, (!e.defined(i) || e.JulianDate.compare(a.clock.startTime, i) < 0) && (i = a.clock.startTime), (!e.defined(n) || e.JulianDate.compare(a.clock.stopTime, n) > 0) && (n = a.clock.stopTime))
            }
            return i = e.defaultValue(i, e.Iso8601.MINIMUM_VALUE.clone()), n = e.defaultValue(n, e.Iso8601.MAXIMUM_VALUE.clone()), (o !== this.timelineVisible || !e.JulianDate.equals(i, this.timelineStart) || !e.JulianDate.equals(n, this.timelineStop)) && (this.timelineVisible = o, this.timelineStart = i.clone(this.timelineStart), this.timelineStop = n.clone(this.timelineStop), requestAnimationFrame(() => {
                this.viewer.forceResize()
            }), !0)
        }

        updateTimelineTrim() {
            if (this.isViewer || !this.timelineVisible || !e.defined(this.activeSlide.startTime) || !e.defined(this.activeSlide.stopTime)) return;
            const t = e.JulianDate.fromIso8601(this.activeSlide.startTime),
                i = e.JulianDate.fromIso8601(this.activeSlide.stopTime), n = this.viewer.timeline,
                o = this.shadowRoot.querySelector("#startNeedle");
            let r = e.JulianDate.secondsDifference(t, this.timelineStart),
                a = Math.round(r * n._topDiv.clientWidth / n._timeBarSecondsSpan) + 1.5 * o.clientWidth - .5;
            o.style.left = a.toString() + "px";
            const s = this.shadowRoot.querySelector("#stopNeedle");
            r = e.JulianDate.secondsDifference(i, this.timelineStart), a = Math.round(r * n._topDiv.clientWidth / n._timeBarSecondsSpan) + 1.5 * s.clientWidth - .5, s.style.left = a.toString() + "px"
        }

        _updateAssetOrder() {
            const e = this._assetState, t = this._assetInstances, i = e.ids, n = e.byId, o = this._viewer;
            for (let e = 0; e < i.length; e++) {
                const r = i[e], a = n[r];
                if (a.status !== re.COMPLETE) continue;
                const s = t.get(r);
                switch (a.type) {
                    case se.IMAGERY:
                        o.scene.imageryLayers.raiseToTop(s);
                        break;
                    case se["3DTILES"]:
                        break;
                    case se.KML:
                    case se.GEOJSON:
                    case se.CZML:
                        o.dataSources.raiseToTop(s)
                }
            }
        }

        _updateAssetsFromActiveSlide() {
            if (!this._ready || !e.defined(this._activeSlide)) return;
            const t = this._activeSlide, i = this.assetState.byId,
                n = e.defaultValue(t.assetSettings, e.defaultValue.EMPTY_OBJECT);
            this._assetState.ids.forEach(t => {
                const o = i[t], r = e.defaultValue(n[t], e.defaultValue.EMPTY_OBJECT),
                    a = this._assetInstances.get(o.id);
                e.defined(a) && (a.show = e.defaultValue(r.show, !1), o.type === se.IMAGERY && (a.alpha = e.defaultValue(r.opacity, 100) / 100))
            })
        }

        _updateActiveSlide() {
            const t = this._activeSlide;
            if (!this._ready || !e.defined(t)) return;
            const i = this.viewer.clockViewModel;
            i.shouldAnimate && t.id !== this._lastActiveSlide.id && (i.shouldAnimate = !1), this._updateAssetsFromActiveSlide(), this._updateTimeline(), this.dispatchEvent(new CustomEvent("timelineChanged", {
                detail: {
                    visible: this.timelineVisible,
                    start: this.timelineStart.clone(),
                    stop: this.timelineStop.clone()
                }
            })), this._setTerrainProvider(t.terrainAssetId), this._viewer.scene.requestRender(), e.defined(this._lastActiveSlide) ? t.id !== this._lastActiveSlide.id ? this.flyToSlide(t) : this.updateAnimation(t) : this.zoomToSlide(t), this._measureWidget.viewModel.expanded = !1, this._lastActiveSlide = t
        }

        ensureEllipsoid() {
            const t = this._viewer.scene.globe;
            t.terrainProvider instanceof e.EllipsoidTerrainProvider || (t.terrainProvider = new e.EllipsoidTerrainProvider)
        }

        async waitForTerrainAsset(e) {
            const t = await _e(e);
            if (e === this._terrainAssetId && re.isPending(t.status)) return this.ensureEllipsoid(), await new Promise(e => setTimeout(e, 5e3)), this.waitForTerrainAsset(e)
        }

        async _setTerrainProvider(t) {
            if (t !== this._terrainAssetId) if (this._terrainAssetId = t, e.defined(t)) {
                if (this.isViewer || await this.waitForTerrainAsset(t), t === this._terrainAssetId) {
                    const i = new e.CesiumTerrainProvider({
                        url: e.IonResource.fromAssetId(t),
                        requestWaterMask: !1,
                        requestVertexNormals: !0
                    }), n = this._viewer.scene.globe;
                    n.terrainProvider = i;
                    try {
                        await i.readyPromise
                    } catch (e) {
                        n.terrainProvider === i && this.ensureEllipsoid(n)
                    }
                }
            } else this.ensureEllipsoid()
        }

        _updateUnits() {
            if (!this._ready) return;
            let t = e.DistanceUnits.METERS, i = e.AreaUnits.SQUARE_METERS, n = e.VolumeUnits.CUBIC_METERS;
            this.unit === wo.US_CUSTOMARY && (t = e.DistanceUnits.FEET, i = e.AreaUnits.SQUARE_FEET, n = e.VolumeUnits.CUBIC_FEET), this._mapScale.distanceUnits = t, this._coordinates.distanceUnits = t;
            const o = this._measureWidget.viewModel.units;
            o.areaUnits = i, o.distanceUnits = t, o.volumeUnits = n
        }

        async captureThumbnail(t, i) {
            return this._measureWidget.viewModel.expanded = !1, new Promise(n => {
                const o = this._viewer.scene, r = this._viewer.clockViewModel.currentTime, a = o.canvas,
                    s = o.camera.frustum, c = a.height, l = a.width, d = o.postUpdate.addEventListener((function () {
                        ko(a, s, i, t), o.requestRender()
                    }));
                let u, h;

                function p() {
                    d(), e.defined(h) && h(), clearTimeout(u);
                    const t = o.postRender.addEventListener((function () {
                        t();
                        const e = a.toDataURL("image/jpeg", .85);
                        ko(a, s, c, l), n(e), o.isDestroyed() || o.requestRender()
                    }));
                    o.requestRender(), o.render(r)
                }

                o.initializeFrame(), o.requestRender(), o.render(r), this._sceneComplete ? p() : (h = this._sceneCompleteChange.addEventListener(p), u = setTimeout(p, 5e3))
            })
        }

        zoomToAsset(e) {
            const t = this._assetInstances.get(e);
            yo(this._viewer, t)
        }

        flyToSlide(t, i) {
            if (!e.defined(this._viewer)) return;
            (i = e.defaultValue(i, e.defaultValue.EMPTY_OBJECT)).resumeAnimation || this.updateAnimation(t);
            const n = t.view.camera, o = t.completeCallback;
            this._viewer.scene.camera.flyTo({
                destination: n.position,
                orientation: {heading: n.heading, pitch: n.pitch, roll: n.roll},
                duration: i.duration,
                complete: () => {
                    this._viewer.clockViewModel.shouldAnimate = this.timelineVisible && this.isViewer, e.defined(o) && o()
                },
                cancel: t.cancelledCallback
            })
        }

        zoomToSlide(e) {
            this.flyToSlide(e, {duration: 0})
        }

        updateAnimation(t) {
            if (!this._ready || !this.timelineVisible) return;
            const i = !e.defined(this._lastActiveSlide) || t.id !== this._lastActiveSlide.id,
                n = this.viewer.clockViewModel;
            let o = e.defined(t.startTime) ? e.JulianDate.fromIso8601(t.startTime) : this.timelineStart,
                r = e.defined(t.stopTime) ? e.JulianDate.fromIso8601(t.stopTime) : this.timelineStop, a = o;
            !i && e.JulianDate.greaterThanOrEquals(n.currentTime, o) && e.JulianDate.lessThanOrEquals(n.currentTime, r) && (a = n.currentTime);
            let s = 1;
            const c = e.JulianDate.compare(o, r);
            if (c > 0) {
                const e = o;
                o = r, r = e, s = -1
            } else 0 === c && (r = e.JulianDate.addSeconds(o, 1, r.clone()));
            n.startTime = o.clone(), n.stopTime = r.clone(), n.multiplier = s * (e.JulianDate.secondsDifference(r, o) / e.defaultValue(t.duration, 10)), this.updateClockRange(), i && (n.currentTime = a.clone()), this.viewer.timeline.updateFromClock(), this.isViewer ? this.viewer.timeline.zoomTo(o, r) : (this._timelineTrack.interval.start = o.clone(), this._timelineTrack.interval.stop = r.clone(), this.viewer.timeline.zoomTo(this.timelineStart, this.timelineStop), this.updateTimelineTrim())
        }

        cancelFlight() {
            this._viewer.scene.camera.cancelFlight()
        }

        pauseAnimation() {
            this._viewer.clockViewModel.shouldAnimate && (this._viewer.clockViewModel.shouldAnimate = !1)
        }

        onKeyDown(t) {
            if (!document.hasFocus() || document.activeElement === document.body || document.activeElement === document.documentElement) {
                if (t.ctrlKey && t.altKey && ("i" === t.key || 73 === t.keyCode)) {
                    const t = this._inspector instanceof e.CesiumInspector;
                    if (e.defined(this._inspector) && (this._inspector = this._inspector.destroy()), t) return;
                    const i = this.shadowRoot.querySelector("#inspectorContainer");
                    this._inspector = new e.CesiumInspector(i, this._viewer.scene)
                } else {
                    if (!t.ctrlKey || !t.altKey || "3" !== t.key && 73 !== t.keyCode) return;
                    {
                        const t = this._inspector instanceof e.Cesium3DTilesInspector;
                        if (e.defined(this._inspector) && (this._inspector = this._inspector.destroy()), t) return;
                        const i = this.shadowRoot.querySelector("#inspectorContainer");
                        this._inspector = new e.Cesium3DTilesInspector(i, this._viewer.scene)
                    }
                }
                t.stopPropagation(), t.preventDefault()
            }
        }
    }), e.Timeline.prototype.makeLabel = function (t) {
        return e.JulianDate.toDate(t).toLocaleString()
    };
    const So = new e.Cartesian2;
    window.customElements.define("ion-modal", class extends ie {
        static get styles() {
            return [Ri, ee`:host{position:fixed;top:0;bottom:0;right:0;left:0;background-color:var(--transparent-overlay-color);z-index:3;display:flex;align-items:center;justify-content:center}.wrapper{width:600px;background-color:var(--body-bg);padding:1rem 1rem 2rem;border-radius:var(--border-radius);max-height:90%;overflow-y:auto}`]
        }

        static get properties() {
            return {}
        }

        constructor() {
            super(), this._onKeyDown = this._onKeyDown.bind(this), this._onPointerDown = this._onPointerDown.bind(this), this._onPointerUp = this._onPointerUp.bind(this), this._pointerDown = new e.Cartesian2, this._pointerUp = new e.Cartesian2
        }

        connectedCallback() {
            super.connectedCallback(), document.addEventListener("keydown", this._onKeyDown, !0), this.addEventListener("pointerdown", this._onPointerDown, !0), this.addEventListener("pointerup", this._onPointerUp, !0)
        }

        disconnectedCallback() {
            this.removeEventListener("pointerdown", this._onPointerDown, !0), this.removeEventListener("pointerup", this._onPointerUp, !0), document.removeEventListener("keydown", this._onKeyDown, !0), super.disconnectedCallback()
        }

        render() {
            return z`<div class="wrapper"><slot></slot></div>`
        }

        _onKeyDown(e) {
            "Escape" !== e.key && 27 !== e.keyCode || this.dispatchEvent(new CustomEvent("close"))
        }

        _onPointerDown(e) {
            this._pointerDown.x = e.clientX, this._pointerDown.y = e.clientY
        }

        _onPointerUp(t) {
            var i, n;
            this._pointerUp.x = t.clientX, this._pointerUp.y = t.clientY, i = this._pointerUp, n = this._pointerDown, e.Cartesian2.magnitude(e.Cartesian2.subtract(i, n, So)) <= 10 && -1 === t.composedPath().indexOf(this.shadowRoot.querySelector(".wrapper")) && this.dispatchEvent(new CustomEvent("close"))
        }
    });

    window.customElements.define("ion-icon-button", class extends ie {
        static get styles() {
            return [ee`:host{display:inline-block;box-sizing:border-box;user-select:none;height:100%;width:1.5rem;color:var(--text-color);cursor:pointer;text-align:center}:host(:focus){outline:0}:host(:hover){color:var(--brand-primary)}:host(:active){color:var(--brand-primary-shade)}:host([disabled]){color:var(--text-muted);cursor:default}a{text-align:center;white-space:nowrap;vertical-align:middle;padding:0;user-select:none;height:100%;width:100%}::slotted(svg){height:100%;width:100%;vertical-align:top}`]
        }

        static get properties() {
            return {theme: {type: String}, disabled: {type: Boolean, reflect: !0}}
        }

        constructor() {
            super(), this.theme = "default", this.disabled = !1
        }

        connectedCallback() {
            super.connectedCallback(), this.addEventListener("click", this._onClick, !0)
        }

        disconnectedCallback() {
            this.removeEventListener("click", this._onClick, !0), super.disconnectedCallback()
        }

        render() {
            return z`<a><slot></slot></a>`
        }

        _onClick(e) {
            this.disabled && e.stopPropagation()
        }
    });
    window.customElements.define("ion-notification", class extends ie {
        constructor() {
            super(), this.id = void 0, this.notificationType = rt, this.message = void 0, this.timeout = 5e3
        }

        static get properties() {
            return {
                id: {type: String},
                active: {type: Boolean, reflect: !0},
                notificationType: {type: String, reflect: !0},
                message: {type: String},
                timeout: {type: Number}
            }
        }

        static get styles() {
            return [Ri, ee`:host{display:block;position:relative}.notification{border-radius:var(--border-radius);background-color:var(--container-bg);padding:0;color:var(--text-color);box-shadow:0 0 10px var(--shadow-color);padding:1rem;opacity:0;transition:opacity .3s ease-in-out;box-sizing:border-box}:host([active]) .notification{opacity:1}.notification-icon{display:inline-block;user-select:none;height:1rem;width:1rem;margin-right:.25rem;margin-left:-.25rem;vertical-align:middle}.notification-message{display:inline-block;vertical-align:top;width:calc(100% - 1.75rem)}.notification-info{background-color:var(--brand-info-bg);color:var(--brand-info-color)}.notification-success{background-color:var(--brand-success-bg);color:var(--brand-success-color)}.notification-error{background-color:var(--brand-danger-bg);color:var(--brand-danger-color)}ion-icon-button{position:absolute;top:.2rem;right:.2rem;height:1rem;width:1rem;color:inherit}`]
        }

        render() {
            let e;
            switch (this.notificationType) {
                case rt:
                    e = gi;
                    break;
                case at:
                    e = bi;
                    break;
                case st:
                    e = fi
            }
            return z`<div class="notification notification-${this.notificationType.toLowerCase()}"><div class="notification-icon">${e.node}</div><div class="notification-message">${this.message}</div><ion-icon-button @click="${this.deactivate}">${yi.node}</ion-icon-button></div>`
        }

        firstUpdated() {
            setTimeout(() => {
                this.active = !0
            }, 300), e.defined(this.timeout) && 0 !== this.timeout && setTimeout(() => {
                this.deactivate()
            }, this.timeout)
        }

        deactivate() {
            this.active = !1, setTimeout(() => {
                this.dispatchEvent(new CustomEvent("close", {detail: {id: this.id}}))
            }, 300)
        }
    });
    window.customElements.define("cesium-toggle", class extends ie {
        static get styles() {
            return [ee`:host{display:inline-block;box-sizing:border-box;font-family:var(--widgets-font-family);color:var(--widgets-text-color)}label{cursor:pointer;display:flex;align-items:center;justify-content:flex-start}.toggle-input-button{position:relative;border-radius:13px;padding:3px}.toggle-input-button:active,.toggle-input-button:focus-within,label:active .toggle-input-button{box-shadow:0 0 0 var(--focus-width) var(--focus-color)}.toggle-button{background-color:var(--widgets-darker-color);border-radius:10px;border:1px solid var(--widgets-lighter-color);height:20px;width:40px;transition:background-color var(--widgets-transition-time) linear;user-select:none;-webkit-user-select:none;-ms-user-select:none;-moz-user-select:none}.toggle-slider{display:block;position:absolute;top:3px;left:3px;border-radius:10px;border:1px solid var(--widgets-lighter-color);height:20px;width:20px;outline:0;cursor:pointer;background-color:var(--widgets-text-color);transition:left var(--widgets-transition-time) ease-in-out}input{z-index:-1;position:absolute;left:16px;outline:0}input:checked+.toggle-button{background-color:var(--widgets-active-color)}input:checked+.toggle-button .toggle-slider{left:calc(100% - 20px - 2px - 3px)}.toggle-button-text{font-weight:400;display:inline-block;padding-left:12px;vertical-align:top;padding-top:2px}label span{margin-left:3px}`]
        }

        static get properties() {
            return {checked: {type: Boolean, reflect: !0}}
        }

        constructor() {
            super(), this.checked = !1
        }

        render() {
            return z`<label for="toggle"><div class="toggle-input-button"><input role="switch" type="checkbox" id="toggle" ?checked="${this.checked}" @change="${this._handleChange}"><div class="toggle-button"><div class="toggle-slider"></div></div></div><span><slot><slot></slot></slot></span></label>`
        }

        _handleChange(e) {
            this.checked = e.currentTarget.checked, e.composed || this.dispatchEvent(new CustomEvent("change"))
        }
    });

    class Eo extends (ne(dt)(ie)) {
        static get styles() {
            return [Ri, ee`button svg{height:1rem;width:1rem}label{color:var(--text-color);font-size:var(--font-size-large);vertical-align:middle}cesium-toggle{margin-left:5px;vertical-align:middle}.copy-icon{margin-left:5px}.confirm-copy{float:right;color:var(--text-muted);opacity:0;transition:opacity var(--transition-time) ease-out}.confirm-copy.copied{opacity:1}#shareLink ion-textfield{display:inline-block;width:calc(100% - 2.5rem)}#shareLink ion-icon-button{vertical-align:top}#shareOptions{display:flex}.share-button{text-align:center;margin-right:1.5rem}.share-button>*{display:block}.share-button>.icon{background-color:var(--container-bg);border-radius:50%;width:1.75rem;height:1.75rem;border:1rem solid #fff;box-sizing:content-box}.share-button>.icon svg{width:1.75rem;height:1.75rem}`]
        }

        static get properties() {
            return {shared: {type: Boolean}}
        }

        constructor() {
            super(), this._storyId = "", this._sharedUrl = "", this.shared = !1, this._toggled = !1, this._urlCopiedTimeout = void 0, this._codeCopiedTimeout = void 0
        }

        render() {
            const e = encodeURIComponent(this._sharedUrl), t = `https://www.facebook.com/sharer/sharer.php?u=${e}`,
                i = `https://twitter.com/intent/tweet?url=${e}`, n = `https://www.linkedin.com/shareArticle/?url=${e}`;
            return z`<h1>Sharing settings</h1><div class="margin-bottom"><label>Enable sharing</label><cesium-toggle id="shared" ?checked="${this.shared}" @change="${this._onToggleChange}"></cesium-toggle><span class="small muted">Sharing is ${this.shared ? "on" : "off"}</span></div><div id="shareLink" class="margin-bottom" ?hidden="${!this.shared}"><div><label>Share url</label><span class="confirm-copy">Copied</span></div><div><ion-textfield id="url" value="${this._sharedUrl}" @click="${this._selectText("url")}" readonly="readonly"></ion-textfield><ion-icon-button class="copy-icon" @click="${this._copyUrl}">${hi.node}</ion-icon-button></div></div><div id="shareOptions" class="margin-bottom" ?hidden="${!this.shared}"><a class="share-button" @click="${this._openEmbedModal}"><span class="icon">${Pi.node}</span> <span>Embed</span> </a><a class="share-button" @click="${this._openWindow(t)}"><span class="icon">${Di.node}</span> <span>Facebook</span> </a><a class="share-button" @click="${this._openWindow(i)}"><span class="icon">${Ii.node}</span> <span>Twitter</span> </a><a class="share-button" @click="${this._openWindow(n)}"><span class="icon">${Ai.node}</span> <span>LinkedIn</span> </a><a class="share-button" href="mailto:?body=${this._sharedUrl}" target="_blank" rel="noopener"><span class="icon">${Li.node}</span> <span>Email</span></a></div><ion-button theme="primary" @click="${this._close}">Okay</ion-button>`
        }

        _selectText(e) {
            return function () {
                this.shadowRoot.querySelector(`#${e}`).select()
            }
        }

        _copyUrl() {
            const e = this.shadowRoot.querySelector("#url");
            e.focus(), e.select();
            try {
                document.execCommand("copy");
                const e = this.shadowRoot.querySelector("#shareLink .confirm-copy");
                e.classList.add("copied"), clearTimeout(this._urlCopiedTimeout), this._urlCopiedTimeout = setTimeout(() => {
                    e.classList.remove("copied")
                }, 1500)
            } catch (e) {
                console.log(e)
            }
        }

        _onToggleChange() {
            this._toggled = !0, dt.dispatch(Oe(this.shadowRoot.querySelector("#shared").checked))
        }

        _openWindow(t) {
            return function () {
                const i = e.defined(window.screenLeft) ? window.screenLeft : window.screenX,
                    n = e.defined(window.screenTop) ? window.screenTop : window.screenY,
                    o = ((window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width) - 600) / 2 + i,
                    r = ((window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height) - 300) / 2 + n,
                    a = window.open(t, void 0, "width=600, height=300, top=" + r + ", left=" + o);
                window.focus && a.focus()
            }
        }

        _openEmbedModal() {
            dt.dispatch(le(Ye))
        }

        _close() {
            this.dispatchEvent(new CustomEvent("close", {bubbles: !0, composed: !0}))
        }

        stateChanged(e) {
            if (e.story.id !== this._storyId) {
                this._storyId = e.story.id;
                const t = window.location.href;
                this._sharedUrl = `${t.replace("editor", "viewer").replace("#", "?id=")}`, this.requestUpdate()
            }
            this.shared !== e.story.shared && (this.shared = e.story.shared, this.shared && this._toggled && this.updateComplete.then(() => {
                this._copyUrl()
            }))
        }
    }

    let To, Mo;
    window.customElements.define("ion-sharing-options", Eo);
    window.customElements.define("cesium-draggable-list", class extends ie {
        static get styles() {
            return [Ri]
        }

        static get properties() {
            return {dragHandleClass: {type: String}}
        }

        constructor() {
            super(), this.dragHandleClass = "", this._observer = void 0, this._items = new e.AssociativeArray, this._dropped = !1, this._dragthing = void 0, this._onPointerDown = this._onPointerDown.bind(this), this._onDragStart = this._onDragStart.bind(this), this._onDragEnd = this._onDragEnd.bind(this), this._onDrop = this._onDrop.bind(this)
        }

        firstUpdated() {
            this._observeItems(), this._updateItems(), this._dragthing = this.shadowRoot.querySelector("#dragthing").assignedElements({flatten: !0})[0]
        }

        disconnectedCallback() {
            super.disconnectedCallback(), this._unobserveItems()
        }

        addToGroup(t, i) {
            const n = t.getAttribute("data-drag-group-id"),
                o = e.defined(n) ? Number(this._items.get(n).getAttribute("data-drag-index")) : void 0,
                r = Number(t.getAttribute("data-drag-index")), a = Number(i.getAttribute("data-drag-index"));
            this.dispatchEvent(new CustomEvent("reorder", {detail: {oldGroupIndex: o, oldIndex: r, newGroupIndex: a}}))
        }

        reorder(t, i, n) {
            const o = t.getAttribute("data-drag-group-id"), r = i.getAttribute("data-drag-group-id"),
                a = e.defined(o) ? Number(this._items.get(o).getAttribute("data-drag-index")) : void 0,
                s = e.defined(r) ? Number(this._items.get(r).getAttribute("data-drag-index")) : void 0,
                c = Number(t.getAttribute("data-drag-index"));
            let l = Number(i.getAttribute("data-drag-index"));
            if (a === s) {
                if (l === c || n && l === c - 1 || !n && l === c + 1) return;
                l > c && (l -= 1)
            }
            n && (l += 1), this.dispatchEvent(new CustomEvent("reorder", {
                detail: {
                    oldGroupIndex: a,
                    oldIndex: c,
                    newIndex: l,
                    newGroupIndex: s
                }
            }))
        }

        _observeItems() {
            this._observer || (this._observer = new MutationObserver(() => {
                this._updateItems()
            }), this._observer.observe(this, {childList: !0}))
        }

        _unobserveItems() {
            this._observer && (this._observer.disconnect(), this._observer = void 0), this._items.values.forEach(e => {
                e.removeEventListener("dragstart", this._onDragStart), e.removeEventListener("drop", this._onDrop)
            }), this._items.removeAll()
        }

        _updateItems() {
            this.shadowRoot.querySelector("#slot").assignedElements({flatten: !0}).forEach((e, t) => {
                if (this._updateItem(e, t), e.classList.contains("droppable")) {
                    const t = e.getAttribute("data-drag-id");
                    e.querySelector("[slot=content]").querySelectorAll(".draggable-child").forEach((e, i) => {
                        this._updateItem(e, i, t)
                    })
                }
                e.setAttribute("data-drag-index", t)
            })
        }

        _updateItem(t, i, n) {
            let o = t.getAttribute("data-drag-id");
            if (!e.defined(o)) {
                if (o = e.createGuid(), "" !== this.dragHandleClass) {
                    const e = () => {
                        const i = t.shadowRoot.querySelector(`.${this.dragHandleClass}`);
                        i.addEventListener("pointerdown", () => {
                            t.setAttribute("draggable", !0)
                        }), i.addEventListener("pointerup", () => {
                            t.setAttribute("draggable", !1)
                        }), t.removeEventListener("ready", e)
                    };
                    t.addEventListener("ready", e)
                } else t.addEventListener("pointerdown", this._onPointerDown), t.style.cursor = "grab";
                t.setAttribute("data-drag-id", o), t.addEventListener("dragstart", this._onDragStart), t.addEventListener("drop", this._onDrop), this._items.set(o, t)
            }
            e.defined(n) ? t.setAttribute("data-drag-group-id", n) : t.removeAttribute("data-drag-group-id"), t.setAttribute("data-drag-index", i)
        }

        _addDropHandlers() {
            Mo.addEventListener("dragend", this._onDragEnd), this._items.values.forEach(e => {
                e.addEventListener("dragover", this._onDragOver, !1)
            })
        }

        _removeDropHandlers() {
            Mo.removeEventListener("dragend", this._onDragEnd), this._items.values.forEach(e => {
                e.removeEventListener("dragover", this._onDragOver, !1)
            })
        }

        _onPointerDown(e) {
            e.currentTarget.setAttribute("draggable", !0)
        }

        _onDragStart(t) {
            const i = t.target, n = JSON.stringify({childId: i.getAttribute("data-drag-id")}), o = t.dataTransfer;
            o.setData("text", n), e.defined(this._dragthing) && o.setDragImage(this._dragthing, 50, 25), o.setData("text", n), this._dropped = !1, To = void 0, Mo = i, this._addDropHandlers()
        }

        _onDragEnd(t) {
            t.target.setAttribute("draggable", !1), this._removeDropHandlers(), !this._dropped && e.defined(To) && (this.reorder(Mo, To, To.classList.contains("drag-after")), this._dropped = !0, To.classList.remove("drag-before", "drag-after"))
        }

        _onDragOver(t) {
            t.preventDefault(), t.stopPropagation(), e.defined(To) && To.classList.remove("drag-before", "drag-after", "drag-over"), To = this;
            const i = t.clientY;
            if (this.classList.contains("droppable") && !Mo.classList.contains("droppable")) {
                const e = this.getBoundingClientRect().top;
                i < e + .25 * this.clientHeight ? this.classList.add("drag-before") : i > e + .75 * this.clientHeight ? this.classList.add("drag-after") : this.classList.add("drag-over")
            } else !function (e, t) {
                return e < t.getBoundingClientRect().top + t.clientHeight / 2
            }(i, this) ? this.classList.add("drag-after") : this.classList.add("drag-before")
        }

        _onDrop(e) {
            e.preventDefault(), e.stopPropagation();
            const t = e.currentTarget;
            let i;
            try {
                i = JSON.parse(e.dataTransfer.getData("text"))
            } catch (e) {
                return
            }
            t.classList.contains("drag-over") ? this.addToGroup(this._items.get(i.childId), t) : this.reorder(this._items.get(i.childId), t, t.classList.contains("drag-after")), this._dropped = !0, t.classList.remove("drag-before", "drag-after", "drag-over")
        }

        render() {
            return z`<div id="items"><slot id="slot"></slot><slot id="dragthing" name="dragthing"></slot></div>`
        }
    });
    const Po = (e, t) => {
        const i = e.startNode.parentNode, n = void 0 === t ? e.endNode : t.startNode, o = i.insertBefore(f(), n);
        i.insertBefore(f(), n);
        const r = new S(e.options);
        return r.insertAfterNode(o), r
    }, Do = (e, t) => (e.setValue(t), e.commit(), e), Io = (e, t, i) => {
        const n = e.startNode.parentNode, o = i ? i.startNode : e.endNode, r = t.endNode.nextSibling;
        r !== o && ((e, t, i = null, n = null) => {
            for (; t !== i;) {
                const i = t.nextSibling;
                e.insertBefore(t, n), t = i
            }
        })(n, t.startNode, r, o)
    }, Ao = e => {
        a(e.startNode.parentNode, e.startNode, e.endNode.nextSibling)
    }, Lo = (e, t, i) => {
        const n = new Map;
        for (let o = t; o <= i; o++) n.set(e[o], o);
        return n
    }, No = new WeakMap, zo = new WeakMap, Ro = n((e, t, i) => {
        let n;
        return void 0 === i ? i = t : void 0 !== t && (n = t), t => {
            if (!(t instanceof S)) throw new Error("repeat can only be used in text bindings");
            const o = No.get(t) || [], r = zo.get(t) || [], a = [], s = [], c = [];
            let l, d, u = 0;
            for (const t of e) c[u] = n ? n(t, u) : u, s[u] = i(t, u), u++;
            let h = 0, p = o.length - 1, m = 0, f = s.length - 1;
            for (; h <= p && m <= f;) if (null === o[h]) h++; else if (null === o[p]) p--; else if (r[h] === c[m]) a[m] = Do(o[h], s[m]), h++, m++; else if (r[p] === c[f]) a[f] = Do(o[p], s[f]), p--, f--; else if (r[h] === c[f]) a[f] = Do(o[h], s[f]), Io(t, o[h], a[f + 1]), h++, f--; else if (r[p] === c[m]) a[m] = Do(o[p], s[m]), Io(t, o[p], o[h]), p--, m++; else if (void 0 === l && (l = Lo(c, m, f), d = Lo(r, h, p)), l.has(r[h])) if (l.has(r[p])) {
                const e = d.get(c[m]), i = void 0 !== e ? o[e] : null;
                if (null === i) {
                    const e = Po(t, o[h]);
                    Do(e, s[m]), a[m] = e
                } else a[m] = Do(i, s[m]), Io(t, i, o[h]), o[e] = null;
                m++
            } else Ao(o[p]), p--; else Ao(o[h]), h++;
            for (; m <= f;) {
                const e = Po(t, a[f + 1]);
                Do(e, s[m]), a[m++] = e
            }
            for (; h <= p;) {
                const e = o[h++];
                null !== e && Ao(e)
            }
            No.set(t, a), zo.set(t, c)
        }
    });
    window.customElements.define("ion-delete-icon-button", class extends ie {
        static get styles() {
            return [Ri, ee`:host{display:inline-block}ion-icon-button{height:100%;width:100%}.trash-icon{margin-right:5px;height:1rem;width:1rem;display:inline-block;vertical-align:middle}.trash-icon+span{vertical-align:middle}.trash-icon>svg{width:100%;height:100%}.popover-wrapper{cursor:pointer;padding:.5rem 1rem;border-radius:var(--border-radius)}.popover-wrapper:hover{background-color:var(--brand-danger-bg)}`]
        }

        static get properties() {
            return {message: {type: String}}
        }

        constructor() {
            super(), this.message = "Confirm delete", this._documentPointerDown = this._documentPointerDown.bind(this)
        }

        _documentPointerDown(e) {
            -1 === e.composedPath().indexOf(this) && this._hideConfirm()
        }

        _hideConfirm() {
            this._active = !1, this.requestUpdate(), document.removeEventListener("pointerdown", this._documentPointerDown)
        }

        _showConfirm(e) {
            e.stopPropagation(), this._active = !0, this.requestUpdate(), document.addEventListener("pointerdown", this._documentPointerDown)
        }

        dispatch() {
            this.dispatchEvent(new CustomEvent("delete")), this._hideConfirm()
        }

        render() {
            return z`<ion-icon-button id="deleteButton" @pointerup="${this._showConfirm}" title="Delete">${mi.node}</ion-icon-button><cesium-popover anchor="#deleteButton" direction="down" ._open="${this._active}"><div class="popover-wrapper" @click="${this.dispatch}"><div class="trash-icon">${mi.node}</div><span>${this.message}</span></div></cesium-popover>`
        }
    });
    window.customElements.define("ion-checkbox", class extends ie {
        static get styles() {
            return [ee`:host{display:inline-block;box-sizing:border-box;cursor:pointer}label{float:right;cursor:pointer;margin-left:.2rem}label:hover+ion-icon-button{color:var(--brand-primary)}ion-icon-button{height:1rem;width:1rem;color:var(--text-color)}`]
        }

        static get properties() {
            return {label: {type: String}, checked: {type: Boolean, reflect: !0}}
        }

        constructor() {
            super(), this.label = "", this.checked = !1
        }

        connectedCallback() {
            super.connectedCallback(), this.addEventListener("click", this._toggle)
        }

        disconnectedCallback() {
            this.removeEventListener("click", this._toggle), super.disconnectedCallback()
        }

        render() {
            return z`${"" !== this.label ? z`<label>${this.label}</label>` : ""}<ion-icon-button>${this.checked ? _i.node : vi.node}</ion-icon-button>`
        }

        _toggle() {
            this.checked = !this.checked, this.dispatchEvent(new CustomEvent("change"))
        }
    });
    window.customElements.define("ion-slider", class extends ie {
        static get styles() {
            return [Ri, ee`:host{font-size:var(--font-size);--track-height:4px;--track-color:var(--gray-light);--track-radius:8px;--slider-color:var(--brand-primary);--slider-height:16px;--slider-text-input-width:3rem}:host([hideValue]) input[type=range]{width:100%}input{color:var(--text-color);display:inline-block}input[type=range]{-webkit-appearance:none;width:calc(100% - var(--slider-text-input-width) - 1rem);vertical-align:middle;background:0 0}input[type=range]:focus{outline:0}input[type=number]{width:var(--slider-text-input-width);margin-left:5px;height:1.5em;padding:0 .5rem;outline:0}input[type=number].invalid{border:1px solid var(--brand-danger);box-shadow:0 0 3px 0 var(--brand-danger)}input[type=range]::-webkit-slider-runnable-track{width:100%;height:var(--track-height);cursor:pointer;background:var(--track-color);border-radius:var(--track-radius);border:1px solid transparent}input[type=range]::-webkit-slider-thumb{height:var(--slider-height);width:var(--slider-height);border-radius:50%;background:var(--slider-color);cursor:pointer;-webkit-appearance:none;margin-top:-7px}input[type=range]::-moz-range-track{width:100%;height:var(--track-height);cursor:pointer;background:var(--gray-light);border-radius:var(--track-radius)}input[type=range]::-moz-range-thumb{height:var(--slider-height);width:var(--slider-height);border-radius:50%;background:var(--slider-color);cursor:pointer}input[type=range]::-ms-track{width:100%;height:var(--track-height);cursor:pointer;background:0 0;border-color:transparent;border-width:39px 0;color:transparent}input[type=range]::-ms-fill-lower{background:var(--track-color);border-radius:50px}input[type=range]::-ms-fill-upper{background:var(--track-color);border-radius:50px}input[type=range]::-ms-thumb{height:var(--slider-height);width:var(--slider-height);border-radius:50%;background:var(--slider-color);cursor:pointer}`]
        }

        static get properties() {
            return {
                min: {type: Number},
                max: {type: Number},
                step: {type: Number},
                value: {type: Number},
                hideValue: {type: Boolean, reflect: !0}
            }
        }

        constructor() {
            super(), this.hideValue = !1, this.min = 0, this.max = 100, this.step = 1, this.value = 50
        }

        render() {
            return z`<div class="range-input"><input type="range" min="${this.min}" max="${this.max}" step="${this.step}" .value="${this.value}" @input="${this.valueChange}"> <input id="field" type="number" class="form-control" min="${this.min}" max="${this.max}" step="any" .value="${this.value}" @input="${this.valueChange}" ?hidden="${this.hideValue}"></div>`
        }

        checkValidity() {
            const t = this.shadowRoot.querySelector("#field"), i = t.valueAsNumber;
            return isNaN(i) || e.defined(this.min) && i < this.min || e.defined(this.max) && i > this.max ? (t.classList.add("invalid"), !1) : (t.classList.remove("invalid"), !0)
        }

        valueChange(e) {
            const t = "" === e.srcElement.value ? NaN : Number(e.srcElement.value);
            isNaN(t) || (this.value = Math.min(this.max, Math.max(this.min, t)), this.dispatchEvent(new CustomEvent("input", {detail: {value: this.value}})))
        }
    });
    window.customElements.define("ion-kabob-menu", class extends ie {
        static get styles() {
            return [Ri, ee`:host{display:inline-block}ion-icon-button{width:1rem}ion-icon-button svg{height:1rem}`]
        }

        constructor() {
            super(), this._documentPointerDown = this._documentPointerDown.bind(this)
        }

        _documentPointerDown(e) {
            -1 === e.composedPath().indexOf(this) && this.hideMenu()
        }

        hideMenu() {
            this._active = !1, this.requestUpdate(), document.removeEventListener("pointerdown", this._documentPointerDown)
        }

        showMenu() {
            this._active = !0, this.requestUpdate(), document.addEventListener("pointerdown", this._documentPointerDown)
        }

        _toggleMenu(e) {
            e.stopPropagation(), this._active ? this.hideMenu() : this.showMenu()
        }

        render() {
            return z`<ion-icon-button id="kabobButton" @pointerup="${this._toggleMenu}" title="Menu">${Mi.node}</ion-icon-button><cesium-popover anchor="#kabobButton" direction="right" ._open="${this._active}"><slot></slot></cesium-popover>`
        }
    });
    window.customElements.define("ion-asset-manager-row", class extends ie {
        static get styles() {
            return [Ri, ee`:host([notshown]){color:var(--text-muted);font-style:italic}.container{padding:.5rem 1rem .5rem 1.75rem;border-bottom:1px solid var(--border-color)}#icons{float:right}ion-delete-icon-button,ion-icon-button,ion-kabob-menu{height:1rem;width:1rem;flex-grow:0;flex-shrink:0}ion-delete-icon-button,ion-icon-button{margin-left:.25rem}ion-kabob-menu{margin-left:.1rem}ion-checkbox{width:1rem;height:1rem;margin-right:.25rem}.warning svg{height:1rem;width:1rem}.error svg{height:1rem;width:1rem}#opacityWrapper{margin-top:.5rem;display:flex}#opacityWrapper ion-slider{width:100%}#opacityWrapper span{margin-right:5px}.row{margin-left:-1.5rem;display:flex;align-items:center}.row span{height:1.2rem}.row.kabob{margin-right:-.75rem}.asset-name{flex-grow:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.draggable-grip{width:1rem;height:1rem;color:var(--gray-light);cursor:grab;vertical-align:top;padding:0;margin-right:.5rem}.draggable-grip svg{height:1rem;width:1rem}ion-loading-icon{height:1rem;width:1rem;margin-right:.25rem}.asset-name-error{color:var(--brand-danger);font-style:italic}.asset-name-incomplete{color:var(--text-muted);font-style:italic}.menu-item{background-color:var(--container-bg);padding:.5rem 1rem;cursor:pointer}.menu-item:hover{background-color:var(--brand-primary-tint)}.row .error,.row .warning{margin-right:.25rem;height:1rem}.reference-button{margin-top:.25rem}`]
        }

        static get properties() {
            return {
                assetMetadata: {type: Object},
                assetSettings: {type: Object},
                pendingUploads: {type: Object},
                notShown: {type: Boolean, reflect: !0}
            }
        }

        constructor() {
            super(), this.assetMetadata = void 0, this._assetSettings = {}, this.pendingUploads = {}, this.notShown = !1
        }

        get assetSettings() {
            return this._assetSettings
        }

        set assetSettings(t) {
            t = e.defaultValue(t, {}), this._assetSettings = t, this.notShown = !t.show, this.requestUpdate()
        }

        firstUpdated() {
            this.dispatchEvent(new CustomEvent("ready"))
        }

        render() {
            const t = this.assetMetadata;
            if (!e.defined(t)) return z``;
            const i = e.defaultValue(this.assetSettings, e.defaultValue.EMPTY_OBJECT), n = e.defaultValue(i.show, !1),
                o = !t.isPremium && e.defined(t.ionExtras) && t.ionExtras.movable && !t.ionExtras.georeferenced,
                r = re.isError(t.status), a = re.isPending(t.status),
                s = n && t.type === se["3DTILES"] && t.status === re.COMPLETE && t.ionExtras.movable;
            let c, l, d = "";
            if (r ? d = "asset-name-error" : (a || o) && (d = "asset-name-incomplete"), a) if (t.status === re.AWAITING_FILES) {
                const i = e.defaultValue(this.pendingUploads[t.id], 0);
                c = Math.floor(.25 * i), l = `Uploading (${c}%)`
            } else c = Math.floor(25 + .75 * t.percentComplete), l = `Tiling (${c}%)`;
            return z`<div class="container"><div class="row${s ? " kabob" : ""}"><div class="draggable-grip">${wi.node}</div><ion-checkbox id="show" ?checked="${n}" @change="${this._onShowChange}"></ion-checkbox>${o ? z`<span class="warning" title="Warning: Not georeferenced">${fi.node}</span>` : ""} ${r ? z`<span class="error" title="Error: ${t.error ? t.error.description : "Unable to load asset"}">${fi.node}</span>` : ""} ${a ? z`<ion-loading-icon></ion-loading-icon><span class="loading-indicator" title="${l}">${c}%</span>` : ""} <span class="asset-name ${d}">${t.name}</span><ion-icon-button title="Zoom to" ?hidden="${!n || o || t.status !== re.COMPLETE}" @click="${this._onZoomClick}">${pi.node}</ion-icon-button><ion-delete-icon-button @delete="${this._onDelete}" message="Remove asset from all slides"></ion-delete-icon-button>${s ? z`<ion-kabob-menu id="c3dtilesMenu" @click="${this._toggleMenu}"><div class="menu-item" @click="${this._onAdjustLocationClick}">Adjust tileset location</div></ion-kabob-menu>` : ""}</div>${o ? z`<div class="reference-button"><ion-button class="btn-small" @click="${this._onAdjustLocationClick}">Adjust tileset location</ion-button></div>` : z``}<div id="opacityWrapper" ?hidden="${!n || t.type !== se.IMAGERY}"><span>Opacity</span><ion-slider id="opacity" hideValue @input="${this._onOpacityChange}" .value="${e.defaultValue(i.opacity, 100)}"></ion-slider></div></div>`
        }

        _onOpacityChange() {
            const e = this.shadowRoot.querySelector("#opacity").value;
            this.dispatchEvent(new CustomEvent("updateAsset", {detail: {opacity: Math.round(e)}}))
        }

        _onShowChange() {
            this.dispatchEvent(new CustomEvent("updateAsset", {detail: {show: this.shadowRoot.querySelector("#show").checked}}))
        }

        _onZoomClick() {
            this.dispatchEvent(new CustomEvent("zoomToAsset"))
        }

        _onDelete() {
            this.dispatchEvent(new CustomEvent("deleteAsset"))
        }

        _onAdjustLocationClick() {
            this.dispatchEvent(new CustomEvent("adjustLocation"))
        }
    });

    class Oo extends (ne(dt)(ie)) {
        static get styles() {
            return [Ri, ee``]
        }

        constructor() {
            super(), this._activeSlide = void 0, this.terrainAssets = [], this.selectedTerrainId = void 0, this._polling = !1
        }

        _schedulePoll(e) {
            this._polling && setTimeout(() => {
                this._polling && this.pollAssets()
            }, e)
        }

        async pollAssets() {
            let e;
            this._polling = !0;
            try {
                e = await ve()
            } catch (e) {
                return void this._schedulePoll(1e4)
            }
            this._polling && (this.terrainAssets = e.filter(e => e.type === se.TERRAIN), this.requestUpdate(), this._polling = this.terrainAssets.some(e => re.isPending(e.status)), this._schedulePoll(5e3))
        }

        connectedCallback() {
            super.connectedCallback(), this.pollAssets()
        }

        disconnectedCallback() {
            super.disconnectedCallback(), this._polling = !1
        }

        render() {
            const e = this.terrainAssets.map(e => {
                let t = e.name;
                const i = re.isError(e.status);
                return e.status === re.AWAITING_FILES ? t += " (Uploading)" : e.status === re.IN_PROGRESS || e.status === re.NOT_STARTED ? t += ` (${e.percentComplete}%)` : i && (t += " (Error)"), {
                    name: t,
                    id: e.id,
                    disabled: i
                }
            });
            return e.sort((e, t) => {
                const i = e.name.toLowerCase(), n = t.name.toLowerCase();
                return i < n ? -1 : n > i ? 1 : 0
            }), e.unshift({
                id: null,
                disabled: !1,
                name: "WGS84 Ellipsoid"
            }), z`<ion-select id="terrainSelector" @focus="${this._onFocus}" .values="${e}" .value="${this.selectedTerrainId}" @change="${this.valueChange}"></ion-select>`
        }

        _onFocus() {
            this._polling || this.pollAssets()
        }

        updated() {
            const t = this.shadowRoot.querySelector("#terrainSelector");
            let i = 0;
            e.defined(this.selectedTerrainId) && (i = this.terrainAssets.findIndex(e => e.id === this.selectedTerrainId), i++), t.selectedIndex = i
        }

        valueChange(e) {
            let t = e.target.value;
            dt.dispatch(Ae(this._activeSlide.id, {terrainAssetId: t}))
        }

        stateChanged(e) {
            const t = we(e);
            this._activeSlide = t, t.terrainAssetId !== this.selectedTerrainId && (this.selectedTerrainId = t.terrainAssetId, this.requestUpdate())
        }
    }

    window.customElements.define("ion-terrain-selector", Oo);

    class $o extends (ne(dt)(ie)) {
        static get styles() {
            return [Ri, ee`:host{width:100%}h3{margin-bottom:.5rem}.asset-table{background-color:var(--container-bg);border:1px solid var(--border-color);border-radius:var(--border-radius)}ion-asset-manager-row{border-top:2px solid transparent}ion-asset-manager-row:last-child{border-bottom:2px solid transparent}ion-asset-manager-row.drag-before{border-top:2px solid var(--brand-primary)}ion-asset-manager-row.drag-after+ion-asset-manager-row{border-top:2px solid var(--brand-primary)}ion-asset-manager-row.drag-after:last-child{border-bottom:2px solid var(--brand-primary)}.add-asset-row{background-color:var(--container-bg);border-radius:var(--border-radius);padding:.5rem 1rem}.add-asset-row ion-icon-button{height:1rem;width:1rem}`]
        }

        constructor() {
            super(), this.assetState = void 0, this.activeSlideAssetSettings = void 0, this._activeSlide = void 0, this.pendingUploads = {}
        }

        render() {
            return z`<h3>Assets</h3><div class="asset-table margin-bottom">${this._renderAssetList()}<div class="add-asset-row"><ion-icon-button theme="primary" @click="${this.showAssetModal}">${Ci.node} Add asset...</ion-icon-button></div></div><h3>Terrain</h3><ion-terrain-selector></ion-terrain-selector>`
        }

        _renderAssetList() {
            const e = this.assetState.ids.map(e => this.assetState.byId[e]).reverse();
            return 0 === e.length ? z`` : z`<cesium-draggable-list dragHandleClass="draggable-grip" @reorder="${this._onAssetReorder}">${Ro(e, e => e.id, e => z`<ion-asset-manager-row .assetMetadata="${e}" .pendingUploads="${this.pendingUploads}" .assetSettings="${this._activeSlideAssetSettings[e.id]}" @updateAsset="${this._onUpdateAsset}" @zoomToAsset="${this._onZoomToAssetEvent}" @deleteAsset="${this._onDeleteAssetEvent}" @adjustLocation="${this._onAdjustLocationEvent}"></ion-asset-manager-row>`)}</cesium-draggable-list>`
        }

        _onAdjustLocationEvent(e) {
            const t = e.target.assetMetadata;
            dt.dispatch(de(t.id))
        }

        _onDeleteAssetEvent(e) {
            const t = e.target.assetMetadata;
            dt.dispatch(Re(t.id))
        }

        _onZoomToAssetEvent(e) {
            const t = e.target.assetMetadata;
            this.dispatchEvent(new CustomEvent("zoomToAsset", {bubbles: !0, composed: !0, detail: {assetId: t.id}}))
        }

        _onAssetReorder(e) {
            const t = e.detail.oldIndex, i = e.detail.newIndex, n = this.assetState.ids.slice().reverse(),
                o = n.splice(t, 1)[0];
            var r;
            n.splice(i, 0, o), n.reverse(), dt.dispatch((r = n, async (e, t) => {
                const i = t().story.id;
                Me(t, () => be(i, {assetIds: r}), e), e({type: "UPDATE_ASSET_ORDER", assetIds: r})
            }))
        }

        _onUpdateAsset(e) {
            const t = e.target.assetMetadata.id, i = e.detail;
            dt.dispatch(Le(this._activeSlide.id, t, i))
        }

        showAssetModal() {
            dt.dispatch(le(Fe))
        }

        showUploadModal() {
            dt.dispatch(le(Be))
        }

        stateChanged(t) {
            t.story.assets !== this.assetState && (this.assetState = t.story.assets, this.requestUpdate());
            const i = we(t);
            this._activeSlide = i, e.defined(i) && i.assetSettings !== this._activeSlideAssetSettings && (this._activeSlideAssetSettings = e.defaultValue(i.assetSettings, e.defaultValue.EMPTY_OBJECT), this.requestUpdate()), this.pendingUploads !== t.app.pendingUploads && (this.pendingUploads = t.app.pendingUploads, this.requestUpdate())
        }
    }

    window.customElements.define("ion-asset-manager", $o);
    var Uo = xn((function (e, t) {
        e.exports = function () {
            var e = function () {
                    return (e = Object.assign || function (e) {
                        for (var t, i = 1, n = arguments.length; i < n; i++) for (var o in t = arguments[i]) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
                        return e
                    }).apply(this, arguments)
                },
                t = ["onChange", "onClose", "onDayCreate", "onDestroy", "onKeyDown", "onMonthChange", "onOpen", "onParseConfig", "onReady", "onValueUpdate", "onYearChange", "onPreCalendarPosition"],
                i = {
                    _disable: [],
                    _enable: [],
                    allowInput: !1,
                    altFormat: "F j, Y",
                    altInput: !1,
                    altInputClass: "form-control input",
                    animate: "object" == typeof window && -1 === window.navigator.userAgent.indexOf("MSIE"),
                    ariaDateFormat: "F j, Y",
                    clickOpens: !0,
                    closeOnSelect: !0,
                    conjunction: ", ",
                    dateFormat: "Y-m-d",
                    defaultHour: 12,
                    defaultMinute: 0,
                    defaultSeconds: 0,
                    disable: [],
                    disableMobile: !1,
                    enable: [],
                    enableSeconds: !1,
                    enableTime: !1,
                    errorHandler: function (e) {
                        return "undefined" != typeof console && console.warn(e)
                    },
                    getWeek: function (e) {
                        var t = new Date(e.getTime());
                        t.setHours(0, 0, 0, 0), t.setDate(t.getDate() + 3 - (t.getDay() + 6) % 7);
                        var i = new Date(t.getFullYear(), 0, 4);
                        return 1 + Math.round(((t.getTime() - i.getTime()) / 864e5 - 3 + (i.getDay() + 6) % 7) / 7)
                    },
                    hourIncrement: 1,
                    ignoredFocusElements: [],
                    inline: !1,
                    locale: "default",
                    minuteIncrement: 5,
                    mode: "single",
                    monthSelectorType: "dropdown",
                    nextArrow: "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",
                    noCalendar: !1,
                    now: new Date,
                    onChange: [],
                    onClose: [],
                    onDayCreate: [],
                    onDestroy: [],
                    onKeyDown: [],
                    onMonthChange: [],
                    onOpen: [],
                    onParseConfig: [],
                    onReady: [],
                    onValueUpdate: [],
                    onYearChange: [],
                    onPreCalendarPosition: [],
                    plugins: [],
                    position: "auto",
                    positionElement: void 0,
                    prevArrow: "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",
                    shorthandCurrentMonth: !1,
                    showMonths: 1,
                    static: !1,
                    time_24hr: !1,
                    weekNumbers: !1,
                    wrap: !1
                }, n = {
                    weekdays: {
                        shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
                        longhand: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
                    },
                    months: {
                        shorthand: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
                        longhand: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
                    },
                    daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
                    firstDayOfWeek: 0,
                    ordinal: function (e) {
                        var t = e % 100;
                        if (t > 3 && t < 21) return "th";
                        switch (t % 10) {
                            case 1:
                                return "st";
                            case 2:
                                return "nd";
                            case 3:
                                return "rd";
                            default:
                                return "th"
                        }
                    },
                    rangeSeparator: " to ",
                    weekAbbreviation: "Wk",
                    scrollTitle: "Scroll to increment",
                    toggleTitle: "Click to toggle",
                    amPM: ["AM", "PM"],
                    yearAriaLabel: "Year",
                    hourAriaLabel: "Hour",
                    minuteAriaLabel: "Minute",
                    time_24hr: !1
                }, o = function (e) {
                    return ("0" + e).slice(-2)
                }, r = function (e) {
                    return !0 === e ? 1 : 0
                };

            function a(e, t, i) {
                var n;
                return void 0 === i && (i = !1), function () {
                    var o = this, r = arguments;
                    null !== n && clearTimeout(n), n = window.setTimeout((function () {
                        n = null, i || e.apply(o, r)
                    }), t), i && !n && e.apply(o, r)
                }
            }

            var s = function (e) {
                return e instanceof Array ? e : [e]
            };

            function c(e, t, i) {
                if (!0 === i) return e.classList.add(t);
                e.classList.remove(t)
            }

            function l(e, t, i) {
                var n = window.document.createElement(e);
                return t = t || "", i = i || "", n.className = t, void 0 !== i && (n.textContent = i), n
            }

            function d(e) {
                for (; e.firstChild;) e.removeChild(e.firstChild)
            }

            function u(e, t) {
                var i = l("div", "numInputWrapper"), n = l("input", "numInput " + e), o = l("span", "arrowUp"),
                    r = l("span", "arrowDown");
                if (-1 === navigator.userAgent.indexOf("MSIE 9.0") ? n.type = "number" : (n.type = "text", n.pattern = "\\d*"), void 0 !== t) for (var a in t) n.setAttribute(a, t[a]);
                return i.appendChild(n), i.appendChild(o), i.appendChild(r), i
            }

            var h = function () {
            }, p = function (e, t, i) {
                return i.months[t ? "shorthand" : "longhand"][e]
            }, m = {
                D: h, F: function (e, t, i) {
                    e.setMonth(i.months.longhand.indexOf(t))
                }, G: function (e, t) {
                    e.setHours(parseFloat(t))
                }, H: function (e, t) {
                    e.setHours(parseFloat(t))
                }, J: function (e, t) {
                    e.setDate(parseFloat(t))
                }, K: function (e, t, i) {
                    e.setHours(e.getHours() % 12 + 12 * r(new RegExp(i.amPM[1], "i").test(t)))
                }, M: function (e, t, i) {
                    e.setMonth(i.months.shorthand.indexOf(t))
                }, S: function (e, t) {
                    e.setSeconds(parseFloat(t))
                }, U: function (e, t) {
                    return new Date(1e3 * parseFloat(t))
                }, W: function (e, t, i) {
                    var n = parseInt(t), o = new Date(e.getFullYear(), 0, 2 + 7 * (n - 1), 0, 0, 0, 0);
                    return o.setDate(o.getDate() - o.getDay() + i.firstDayOfWeek), o
                }, Y: function (e, t) {
                    e.setFullYear(parseFloat(t))
                }, Z: function (e, t) {
                    return new Date(t)
                }, d: function (e, t) {
                    e.setDate(parseFloat(t))
                }, h: function (e, t) {
                    e.setHours(parseFloat(t))
                }, i: function (e, t) {
                    e.setMinutes(parseFloat(t))
                }, j: function (e, t) {
                    e.setDate(parseFloat(t))
                }, l: h, m: function (e, t) {
                    e.setMonth(parseFloat(t) - 1)
                }, n: function (e, t) {
                    e.setMonth(parseFloat(t) - 1)
                }, s: function (e, t) {
                    e.setSeconds(parseFloat(t))
                }, u: function (e, t) {
                    return new Date(parseFloat(t))
                }, w: h, y: function (e, t) {
                    e.setFullYear(2e3 + parseFloat(t))
                }
            }, f = {
                D: "(\\w+)",
                F: "(\\w+)",
                G: "(\\d\\d|\\d)",
                H: "(\\d\\d|\\d)",
                J: "(\\d\\d|\\d)\\w+",
                K: "",
                M: "(\\w+)",
                S: "(\\d\\d|\\d)",
                U: "(.+)",
                W: "(\\d\\d|\\d)",
                Y: "(\\d{4})",
                Z: "(.+)",
                d: "(\\d\\d|\\d)",
                h: "(\\d\\d|\\d)",
                i: "(\\d\\d|\\d)",
                j: "(\\d\\d|\\d)",
                l: "(\\w+)",
                m: "(\\d\\d|\\d)",
                n: "(\\d\\d|\\d)",
                s: "(\\d\\d|\\d)",
                u: "(.+)",
                w: "(\\d\\d|\\d)",
                y: "(\\d{2})"
            }, g = {
                Z: function (e) {
                    return e.toISOString()
                }, D: function (e, t, i) {
                    return t.weekdays.shorthand[g.w(e, t, i)]
                }, F: function (e, t, i) {
                    return p(g.n(e, t, i) - 1, !1, t)
                }, G: function (e, t, i) {
                    return o(g.h(e, t, i))
                }, H: function (e) {
                    return o(e.getHours())
                }, J: function (e, t) {
                    return void 0 !== t.ordinal ? e.getDate() + t.ordinal(e.getDate()) : e.getDate()
                }, K: function (e, t) {
                    return t.amPM[r(e.getHours() > 11)]
                }, M: function (e, t) {
                    return p(e.getMonth(), !0, t)
                }, S: function (e) {
                    return o(e.getSeconds())
                }, U: function (e) {
                    return e.getTime() / 1e3
                }, W: function (e, t, i) {
                    return i.getWeek(e)
                }, Y: function (e) {
                    return e.getFullYear()
                }, d: function (e) {
                    return o(e.getDate())
                }, h: function (e) {
                    return e.getHours() % 12 ? e.getHours() % 12 : 12
                }, i: function (e) {
                    return o(e.getMinutes())
                }, j: function (e) {
                    return e.getDate()
                }, l: function (e, t) {
                    return t.weekdays.longhand[e.getDay()]
                }, m: function (e) {
                    return o(e.getMonth() + 1)
                }, n: function (e) {
                    return e.getMonth() + 1
                }, s: function (e) {
                    return e.getSeconds()
                }, u: function (e) {
                    return e.getTime()
                }, w: function (e) {
                    return e.getDay()
                }, y: function (e) {
                    return String(e.getFullYear()).substring(2)
                }
            }, b = function (e) {
                var t = e.config, o = void 0 === t ? i : t, r = e.l10n, a = void 0 === r ? n : r;
                return function (e, t, i) {
                    var n = i || a;
                    return void 0 !== o.formatDate ? o.formatDate(e, t, n) : t.split("").map((function (t, i, r) {
                        return g[t] && "\\" !== r[i - 1] ? g[t](e, n, o) : "\\" !== t ? t : ""
                    })).join("")
                }
            }, v = function (e) {
                var t = e.config, o = void 0 === t ? i : t, r = e.l10n, a = void 0 === r ? n : r;
                return function (e, t, n, r) {
                    if (0 === e || e) {
                        var s, c = r || a, l = e;
                        if (e instanceof Date) s = new Date(e.getTime()); else if ("string" != typeof e && void 0 !== e.toFixed) s = new Date(e); else if ("string" == typeof e) {
                            var d = t || (o || i).dateFormat, u = String(e).trim();
                            if ("today" === u) s = new Date, n = !0; else if (/Z$/.test(u) || /GMT$/.test(u)) s = new Date(e); else if (o && o.parseDate) s = o.parseDate(e, d); else {
                                s = o && o.noCalendar ? new Date((new Date).setHours(0, 0, 0, 0)) : new Date((new Date).getFullYear(), 0, 1, 0, 0, 0, 0);
                                for (var h = void 0, p = [], g = 0, b = 0, v = ""; g < d.length; g++) {
                                    var _ = d[g], w = "\\" === _, y = "\\" === d[g - 1] || w;
                                    if (f[_] && !y) {
                                        v += f[_];
                                        var x = new RegExp(v).exec(e);
                                        x && (h = !0) && p["Y" !== _ ? "push" : "unshift"]({fn: m[_], val: x[++b]})
                                    } else w || (v += ".");
                                    p.forEach((function (e) {
                                        var t = e.fn, i = e.val;
                                        return s = t(s, i, c) || s
                                    }))
                                }
                                s = h ? s : void 0
                            }
                        }
                        if (s instanceof Date && !isNaN(s.getTime())) return !0 === n && s.setHours(0, 0, 0, 0), s;
                        o.errorHandler(new Error("Invalid date provided: " + l))
                    }
                }
            };

            function _(e, t, i) {
                return void 0 === i && (i = !0), !1 !== i ? new Date(e.getTime()).setHours(0, 0, 0, 0) - new Date(t.getTime()).setHours(0, 0, 0, 0) : e.getTime() - t.getTime()
            }

            var w = 864e5;

            function y(h, m) {
                var g = {config: e({}, i, k.defaultConfig), l10n: n};

                function y(e) {
                    return e.bind(g)
                }

                function x() {
                    var e = g.config;
                    !1 === e.weekNumbers && 1 === e.showMonths || !0 !== e.noCalendar && window.requestAnimationFrame((function () {
                        if (void 0 !== g.calendarContainer && (g.calendarContainer.style.visibility = "hidden", g.calendarContainer.style.display = "block"), void 0 !== g.daysContainer) {
                            var t = (g.days.offsetWidth + 1) * e.showMonths;
                            g.daysContainer.style.width = t + "px", g.calendarContainer.style.width = t + (void 0 !== g.weekWrapper ? g.weekWrapper.offsetWidth : 0) + "px", g.calendarContainer.style.removeProperty("visibility"), g.calendarContainer.style.removeProperty("display")
                        }
                    }))
                }

                function S(e) {
                    0 === g.selectedDates.length && ie(), void 0 !== e && "blur" !== e.type && function (e) {
                        e.preventDefault();
                        var t = "keydown" === e.type, i = e.target;
                        void 0 !== g.amPM && e.target === g.amPM && (g.amPM.textContent = g.l10n.amPM[r(g.amPM.textContent === g.l10n.amPM[0])]);
                        var n = parseFloat(i.getAttribute("min")), a = parseFloat(i.getAttribute("max")),
                            s = parseFloat(i.getAttribute("step")), c = parseInt(i.value, 10),
                            l = e.delta || (t ? 38 === e.which ? 1 : -1 : 0), d = c + s * l;
                        if (void 0 !== i.value && 2 === i.value.length) {
                            var u = i === g.hourElement, h = i === g.minuteElement;
                            d < n ? (d = a + d + r(!u) + (r(u) && r(!g.amPM)), h && z(void 0, -1, g.hourElement)) : d > a && (d = i === g.hourElement ? d - a - r(!g.amPM) : n, h && z(void 0, 1, g.hourElement)), g.amPM && u && (1 === s ? d + c === 23 : Math.abs(d - c) > s) && (g.amPM.textContent = g.l10n.amPM[r(g.amPM.textContent === g.l10n.amPM[0])]), i.value = o(d)
                        }
                    }(e);
                    var t = g._input.value;
                    C(), be(), g._input.value !== t && g._debouncedChange()
                }

                function C() {
                    if (void 0 !== g.hourElement && void 0 !== g.minuteElement) {
                        var e, t, i = (parseInt(g.hourElement.value.slice(-2), 10) || 0) % 24,
                            n = (parseInt(g.minuteElement.value, 10) || 0) % 60,
                            o = void 0 !== g.secondElement ? (parseInt(g.secondElement.value, 10) || 0) % 60 : 0;
                        void 0 !== g.amPM && (e = i, t = g.amPM.textContent, i = e % 12 + 12 * r(t === g.l10n.amPM[1]));
                        var a = void 0 !== g.config.minTime || g.config.minDate && g.minDateHasTime && g.latestSelectedDateObj && 0 === _(g.latestSelectedDateObj, g.config.minDate, !0);
                        if (void 0 !== g.config.maxTime || g.config.maxDate && g.maxDateHasTime && g.latestSelectedDateObj && 0 === _(g.latestSelectedDateObj, g.config.maxDate, !0)) {
                            var s = void 0 !== g.config.maxTime ? g.config.maxTime : g.config.maxDate;
                            (i = Math.min(i, s.getHours())) === s.getHours() && (n = Math.min(n, s.getMinutes())), n === s.getMinutes() && (o = Math.min(o, s.getSeconds()))
                        }
                        if (a) {
                            var c = void 0 !== g.config.minTime ? g.config.minTime : g.config.minDate;
                            (i = Math.max(i, c.getHours())) === c.getHours() && (n = Math.max(n, c.getMinutes())), n === c.getMinutes() && (o = Math.max(o, c.getSeconds()))
                        }
                        M(i, n, o)
                    }
                }

                function E(e) {
                    var t = e || g.latestSelectedDateObj;
                    t && M(t.getHours(), t.getMinutes(), t.getSeconds())
                }

                function T() {
                    var e = g.config.defaultHour, t = g.config.defaultMinute, i = g.config.defaultSeconds;
                    if (void 0 !== g.config.minDate) {
                        var n = g.config.minDate.getHours(), o = g.config.minDate.getMinutes();
                        (e = Math.max(e, n)) === n && (t = Math.max(o, t)), e === n && t === o && (i = g.config.minDate.getSeconds())
                    }
                    if (void 0 !== g.config.maxDate) {
                        var r = g.config.maxDate.getHours(), a = g.config.maxDate.getMinutes();
                        (e = Math.min(e, r)) === r && (t = Math.min(a, t)), e === r && t === a && (i = g.config.maxDate.getSeconds())
                    }
                    M(e, t, i)
                }

                function M(e, t, i) {
                    void 0 !== g.latestSelectedDateObj && g.latestSelectedDateObj.setHours(e % 24, t, i || 0, 0), g.hourElement && g.minuteElement && !g.isMobile && (g.hourElement.value = o(g.config.time_24hr ? e : (12 + e) % 12 + 12 * r(e % 12 == 0)), g.minuteElement.value = o(t), void 0 !== g.amPM && (g.amPM.textContent = g.l10n.amPM[r(e >= 12)]), void 0 !== g.secondElement && (g.secondElement.value = o(i)))
                }

                function P(e) {
                    var t = parseInt(e.target.value) + (e.delta || 0);
                    (t / 1e3 > 1 || "Enter" === e.key && !/[^\d]/.test(t.toString())) && K(t)
                }

                function D(e, t, i, n) {
                    return t instanceof Array ? t.forEach((function (t) {
                        return D(e, t, i, n)
                    })) : e instanceof Array ? e.forEach((function (e) {
                        return D(e, t, i, n)
                    })) : (e.addEventListener(t, i, n), void g._handlers.push({
                        element: e,
                        event: t,
                        handler: i,
                        options: n
                    }))
                }

                function I(e) {
                    return function (t) {
                        1 === t.which && e(t)
                    }
                }

                function A() {
                    he("onChange")
                }

                function L(e, t) {
                    var i = void 0 !== e ? g.parseDate(e) : g.latestSelectedDateObj || (g.config.minDate && g.config.minDate > g.now ? g.config.minDate : g.config.maxDate && g.config.maxDate < g.now ? g.config.maxDate : g.now),
                        n = g.currentYear, o = g.currentMonth;
                    try {
                        void 0 !== i && (g.currentYear = i.getFullYear(), g.currentMonth = i.getMonth())
                    } catch (e) {
                        e.message = "Invalid date supplied: " + i, g.config.errorHandler(e)
                    }
                    t && g.currentYear !== n && (he("onYearChange"), V()), !t || g.currentYear === n && g.currentMonth === o || he("onMonthChange"), g.redraw()
                }

                function N(e) {
                    ~e.target.className.indexOf("arrow") && z(e, e.target.classList.contains("arrowUp") ? 1 : -1)
                }

                function z(e, t, i) {
                    var n = e && e.target, o = i || n && n.parentNode && n.parentNode.firstChild, r = pe("increment");
                    r.delta = t, o && o.dispatchEvent(r)
                }

                function R(e, t, i, n) {
                    var o = Z(t, !0), r = l("span", "flatpickr-day " + e, t.getDate().toString());
                    return r.dateObj = t, r.$i = n, r.setAttribute("aria-label", g.formatDate(t, g.config.ariaDateFormat)), -1 === e.indexOf("hidden") && 0 === _(t, g.now) && (g.todayDateElem = r, r.classList.add("today"), r.setAttribute("aria-current", "date")), o ? (r.tabIndex = -1, me(t) && (r.classList.add("selected"), g.selectedDateElem = r, "range" === g.config.mode && (c(r, "startRange", g.selectedDates[0] && 0 === _(t, g.selectedDates[0], !0)), c(r, "endRange", g.selectedDates[1] && 0 === _(t, g.selectedDates[1], !0)), "nextMonthDay" === e && r.classList.add("inRange")))) : r.classList.add("flatpickr-disabled"), "range" === g.config.mode && function (e) {
                        return !("range" !== g.config.mode || g.selectedDates.length < 2) && _(e, g.selectedDates[0]) >= 0 && _(e, g.selectedDates[1]) <= 0
                    }(t) && !me(t) && r.classList.add("inRange"), g.weekNumbers && 1 === g.config.showMonths && "prevMonthDay" !== e && i % 7 == 1 && g.weekNumbers.insertAdjacentHTML("beforeend", "<span class='flatpickr-day'>" + g.config.getWeek(t) + "</span>"), he("onDayCreate", r), r
                }

                function O(e) {
                    e.focus(), "range" === g.config.mode && ee(e)
                }

                function $(e) {
                    for (var t = e > 0 ? 0 : g.config.showMonths - 1, i = e > 0 ? g.config.showMonths : -1, n = t; n != i; n += e) for (var o = g.daysContainer.children[n], r = e > 0 ? 0 : o.children.length - 1, a = e > 0 ? o.children.length : -1, s = r; s != a; s += e) {
                        var c = o.children[s];
                        if (-1 === c.className.indexOf("hidden") && Z(c.dateObj)) return c
                    }
                }

                function U(e, t) {
                    var i = X(document.activeElement || document.body),
                        n = void 0 !== e ? e : i ? document.activeElement : void 0 !== g.selectedDateElem && X(g.selectedDateElem) ? g.selectedDateElem : void 0 !== g.todayDateElem && X(g.todayDateElem) ? g.todayDateElem : $(t > 0 ? 1 : -1);
                    return void 0 === n ? g._input.focus() : i ? void function (e, t) {
                        for (var i = -1 === e.className.indexOf("Month") ? e.dateObj.getMonth() : g.currentMonth, n = t > 0 ? g.config.showMonths : -1, o = t > 0 ? 1 : -1, r = i - g.currentMonth; r != n; r += o) for (var a = g.daysContainer.children[r], s = i - g.currentMonth === r ? e.$i + t : t < 0 ? a.children.length - 1 : 0, c = a.children.length, l = s; l >= 0 && l < c && l != (t > 0 ? c : -1); l += o) {
                            var d = a.children[l];
                            if (-1 === d.className.indexOf("hidden") && Z(d.dateObj) && Math.abs(e.$i - l) >= Math.abs(t)) return O(d)
                        }
                        g.changeMonth(o), U($(o), 0)
                    }(n, t) : O(n)
                }

                function j(e, t) {
                    for (var i = (new Date(e, t, 1).getDay() - g.l10n.firstDayOfWeek + 7) % 7, n = g.utils.getDaysInMonth((t - 1 + 12) % 12), o = g.utils.getDaysInMonth(t), r = window.document.createDocumentFragment(), a = g.config.showMonths > 1, s = a ? "prevMonthDay hidden" : "prevMonthDay", c = a ? "nextMonthDay hidden" : "nextMonthDay", d = n + 1 - i, u = 0; d <= n; d++, u++) r.appendChild(R(s, new Date(e, t - 1, d), d, u));
                    for (d = 1; d <= o; d++, u++) r.appendChild(R("", new Date(e, t, d), d, u));
                    for (var h = o + 1; h <= 42 - i && (1 === g.config.showMonths || u % 7 != 0); h++, u++) r.appendChild(R(c, new Date(e, t + 1, h % o), h, u));
                    var p = l("div", "dayContainer");
                    return p.appendChild(r), p
                }

                function F() {
                    if (void 0 !== g.daysContainer) {
                        d(g.daysContainer), g.weekNumbers && d(g.weekNumbers);
                        for (var e = document.createDocumentFragment(), t = 0; t < g.config.showMonths; t++) {
                            var i = new Date(g.currentYear, g.currentMonth, 1);
                            i.setMonth(g.currentMonth + t), e.appendChild(j(i.getFullYear(), i.getMonth()))
                        }
                        g.daysContainer.appendChild(e), g.days = g.daysContainer.firstChild, "range" === g.config.mode && 1 === g.selectedDates.length && ee()
                    }
                }

                function V() {
                    if (!(g.config.showMonths > 1 || "dropdown" !== g.config.monthSelectorType)) {
                        var e = function (e) {
                            return !(void 0 !== g.config.minDate && g.currentYear === g.config.minDate.getFullYear() && e < g.config.minDate.getMonth() || void 0 !== g.config.maxDate && g.currentYear === g.config.maxDate.getFullYear() && e > g.config.maxDate.getMonth())
                        };
                        g.monthsDropdownContainer.tabIndex = -1, g.monthsDropdownContainer.innerHTML = "";
                        for (var t = 0; t < 12; t++) if (e(t)) {
                            var i = l("option", "flatpickr-monthDropdown-month");
                            i.value = new Date(g.currentYear, t).getMonth().toString(), i.textContent = p(t, g.config.shorthandCurrentMonth, g.l10n), i.tabIndex = -1, g.currentMonth === t && (i.selected = !0), g.monthsDropdownContainer.appendChild(i)
                        }
                    }
                }

                function H() {
                    var e, t = l("div", "flatpickr-month"), i = window.document.createDocumentFragment();
                    g.config.showMonths > 1 || "static" === g.config.monthSelectorType ? e = l("span", "cur-month") : (g.monthsDropdownContainer = l("select", "flatpickr-monthDropdown-months"), D(g.monthsDropdownContainer, "change", (function (e) {
                        var t = e.target, i = parseInt(t.value, 10);
                        g.changeMonth(i - g.currentMonth), he("onMonthChange")
                    })), V(), e = g.monthsDropdownContainer);
                    var n = u("cur-year", {tabindex: "-1"}), o = n.getElementsByTagName("input")[0];
                    o.setAttribute("aria-label", g.l10n.yearAriaLabel), g.config.minDate && o.setAttribute("min", g.config.minDate.getFullYear().toString()), g.config.maxDate && (o.setAttribute("max", g.config.maxDate.getFullYear().toString()), o.disabled = !!g.config.minDate && g.config.minDate.getFullYear() === g.config.maxDate.getFullYear());
                    var r = l("div", "flatpickr-current-month");
                    return r.appendChild(e), r.appendChild(n), i.appendChild(r), t.appendChild(i), {
                        container: t,
                        yearElement: o,
                        monthElement: e
                    }
                }

                function q() {
                    d(g.monthNav), g.monthNav.appendChild(g.prevMonthNav), g.config.showMonths && (g.yearElements = [], g.monthElements = []);
                    for (var e = g.config.showMonths; e--;) {
                        var t = H();
                        g.yearElements.push(t.yearElement), g.monthElements.push(t.monthElement), g.monthNav.appendChild(t.container)
                    }
                    g.monthNav.appendChild(g.nextMonthNav)
                }

                function B() {
                    g.weekdayContainer ? d(g.weekdayContainer) : g.weekdayContainer = l("div", "flatpickr-weekdays");
                    for (var e = g.config.showMonths; e--;) {
                        var t = l("div", "flatpickr-weekdaycontainer");
                        g.weekdayContainer.appendChild(t)
                    }
                    return W(), g.weekdayContainer
                }

                function W() {
                    if (g.weekdayContainer) {
                        var e = g.l10n.firstDayOfWeek, t = g.l10n.weekdays.shorthand.slice();
                        e > 0 && e < t.length && (t = t.splice(e, t.length).concat(t.splice(0, e)));
                        for (var i = g.config.showMonths; i--;) g.weekdayContainer.children[i].innerHTML = "\n      <span class='flatpickr-weekday'>\n        " + t.join("</span><span class='flatpickr-weekday'>") + "\n      </span>\n      "
                    }
                }

                function Y(e, t) {
                    void 0 === t && (t = !0);
                    var i = t ? e : e - g.currentMonth;
                    i < 0 && !0 === g._hidePrevMonthArrow || i > 0 && !0 === g._hideNextMonthArrow || (g.currentMonth += i, (g.currentMonth < 0 || g.currentMonth > 11) && (g.currentYear += g.currentMonth > 11 ? 1 : -1, g.currentMonth = (g.currentMonth + 12) % 12, he("onYearChange"), V()), F(), he("onMonthChange"), fe())
                }

                function G(e) {
                    return !(!g.config.appendTo || !g.config.appendTo.contains(e)) || g.calendarContainer.contains(e)
                }

                function J(e) {
                    if (g.isOpen && !g.config.inline) {
                        var t = "function" == typeof (a = e).composedPath ? a.composedPath()[0] : a.target, i = G(t),
                            n = t === g.input || t === g.altInput || g.element.contains(t) || e.path && e.path.indexOf && (~e.path.indexOf(g.input) || ~e.path.indexOf(g.altInput)),
                            o = "blur" === e.type ? n && e.relatedTarget && !G(e.relatedTarget) : !n && !i && !G(e.relatedTarget),
                            r = !g.config.ignoredFocusElements.some((function (e) {
                                return e.contains(t)
                            }));
                        o && r && (void 0 !== g.timeContainer && void 0 !== g.minuteElement && void 0 !== g.hourElement && S(), g.close(), "range" === g.config.mode && 1 === g.selectedDates.length && (g.clear(!1), g.redraw()))
                    }
                    var a
                }

                function K(e) {
                    if (!(!e || g.config.minDate && e < g.config.minDate.getFullYear() || g.config.maxDate && e > g.config.maxDate.getFullYear())) {
                        var t = e, i = g.currentYear !== t;
                        g.currentYear = t || g.currentYear, g.config.maxDate && g.currentYear === g.config.maxDate.getFullYear() ? g.currentMonth = Math.min(g.config.maxDate.getMonth(), g.currentMonth) : g.config.minDate && g.currentYear === g.config.minDate.getFullYear() && (g.currentMonth = Math.max(g.config.minDate.getMonth(), g.currentMonth)), i && (g.redraw(), he("onYearChange"), V())
                    }
                }

                function Z(e, t) {
                    void 0 === t && (t = !0);
                    var i = g.parseDate(e, void 0, t);
                    if (g.config.minDate && i && _(i, g.config.minDate, void 0 !== t ? t : !g.minDateHasTime) < 0 || g.config.maxDate && i && _(i, g.config.maxDate, void 0 !== t ? t : !g.maxDateHasTime) > 0) return !1;
                    if (0 === g.config.enable.length && 0 === g.config.disable.length) return !0;
                    if (void 0 === i) return !1;
                    for (var n = g.config.enable.length > 0, o = n ? g.config.enable : g.config.disable, r = 0, a = void 0; r < o.length; r++) {
                        if ("function" == typeof (a = o[r]) && a(i)) return n;
                        if (a instanceof Date && void 0 !== i && a.getTime() === i.getTime()) return n;
                        if ("string" == typeof a && void 0 !== i) {
                            var s = g.parseDate(a, void 0, !0);
                            return s && s.getTime() === i.getTime() ? n : !n
                        }
                        if ("object" == typeof a && void 0 !== i && a.from && a.to && i.getTime() >= a.from.getTime() && i.getTime() <= a.to.getTime()) return n
                    }
                    return !n
                }

                function X(e) {
                    return void 0 !== g.daysContainer && -1 === e.className.indexOf("hidden") && g.daysContainer.contains(e)
                }

                function Q(e) {
                    var t = e.target === g._input, i = g.config.allowInput, n = g.isOpen && (!i || !t),
                        o = g.config.inline && t && !i;
                    if (13 === e.keyCode && t) {
                        if (i) return g.setDate(g._input.value, !0, e.target === g.altInput ? g.config.altFormat : g.config.dateFormat), e.target.blur();
                        g.open()
                    } else if (G(e.target) || n || o) {
                        var r = !!g.timeContainer && g.timeContainer.contains(e.target);
                        switch (e.keyCode) {
                            case 13:
                                r ? (e.preventDefault(), S(), se()) : ce(e);
                                break;
                            case 27:
                                e.preventDefault(), se();
                                break;
                            case 8:
                            case 46:
                                t && !g.config.allowInput && (e.preventDefault(), g.clear());
                                break;
                            case 37:
                            case 39:
                                if (r || t) g.hourElement && g.hourElement.focus(); else if (e.preventDefault(), void 0 !== g.daysContainer && (!1 === i || document.activeElement && X(document.activeElement))) {
                                    var a = 39 === e.keyCode ? 1 : -1;
                                    e.ctrlKey ? (e.stopPropagation(), Y(a), U($(1), 0)) : U(void 0, a)
                                }
                                break;
                            case 38:
                            case 40:
                                e.preventDefault();
                                var s = 40 === e.keyCode ? 1 : -1;
                                g.daysContainer && void 0 !== e.target.$i || e.target === g.input || e.target === g.altInput ? e.ctrlKey ? (e.stopPropagation(), K(g.currentYear - s), U($(1), 0)) : r || U(void 0, 7 * s) : e.target === g.currentYearElement ? K(g.currentYear - s) : g.config.enableTime && (!r && g.hourElement && g.hourElement.focus(), S(e), g._debouncedChange());
                                break;
                            case 9:
                                if (r) {
                                    var c = [g.hourElement, g.minuteElement, g.secondElement, g.amPM].concat(g.pluginElements).filter((function (e) {
                                        return e
                                    })), l = c.indexOf(e.target);
                                    if (-1 !== l) {
                                        var d = c[l + (e.shiftKey ? -1 : 1)];
                                        e.preventDefault(), (d || g._input).focus()
                                    }
                                } else !g.config.noCalendar && g.daysContainer && g.daysContainer.contains(e.target) && e.shiftKey && (e.preventDefault(), g._input.focus())
                        }
                    }
                    if (void 0 !== g.amPM && e.target === g.amPM) switch (e.key) {
                        case g.l10n.amPM[0].charAt(0):
                        case g.l10n.amPM[0].charAt(0).toLowerCase():
                            g.amPM.textContent = g.l10n.amPM[0], C(), be();
                            break;
                        case g.l10n.amPM[1].charAt(0):
                        case g.l10n.amPM[1].charAt(0).toLowerCase():
                            g.amPM.textContent = g.l10n.amPM[1], C(), be()
                    }
                    (t || G(e.target)) && he("onKeyDown", e)
                }

                function ee(e) {
                    if (1 === g.selectedDates.length && (!e || e.classList.contains("flatpickr-day") && !e.classList.contains("flatpickr-disabled"))) {
                        for (var t = e ? e.dateObj.getTime() : g.days.firstElementChild.dateObj.getTime(), i = g.parseDate(g.selectedDates[0], void 0, !0).getTime(), n = Math.min(t, g.selectedDates[0].getTime()), o = Math.max(t, g.selectedDates[0].getTime()), r = !1, a = 0, s = 0, c = n; c < o; c += w) Z(new Date(c), !0) || (r = r || c > n && c < o, c < i && (!a || c > a) ? a = c : c > i && (!s || c < s) && (s = c));
                        for (var l = 0; l < g.config.showMonths; l++) for (var d = g.daysContainer.children[l], u = function (n, o) {
                            var c, l, u, h = d.children[n], p = h.dateObj.getTime(),
                                m = a > 0 && p < a || s > 0 && p > s;
                            return m ? (h.classList.add("notAllowed"), ["inRange", "startRange", "endRange"].forEach((function (e) {
                                h.classList.remove(e)
                            })), "continue") : r && !m ? "continue" : (["startRange", "inRange", "endRange", "notAllowed"].forEach((function (e) {
                                h.classList.remove(e)
                            })), void (void 0 !== e && (e.classList.add(t <= g.selectedDates[0].getTime() ? "startRange" : "endRange"), i < t && p === i ? h.classList.add("startRange") : i > t && p === i && h.classList.add("endRange"), p >= a && (0 === s || p <= s) && (l = i, u = t, (c = p) > Math.min(l, u) && c < Math.max(l, u)) && h.classList.add("inRange"))))
                        }, h = 0, p = d.children.length; h < p; h++) u(h)
                    }
                }

                function te() {
                    !g.isOpen || g.config.static || g.config.inline || re()
                }

                function ie() {
                    g.setDate(void 0 !== g.config.minDate ? new Date(g.config.minDate.getTime()) : new Date, !0), T(), be()
                }

                function ne(e) {
                    return function (t) {
                        var i = g.config["_" + e + "Date"] = g.parseDate(t, g.config.dateFormat),
                            n = g.config["_" + ("min" === e ? "max" : "min") + "Date"];
                        void 0 !== i && (g["min" === e ? "minDateHasTime" : "maxDateHasTime"] = i.getHours() > 0 || i.getMinutes() > 0 || i.getSeconds() > 0), g.selectedDates && (g.selectedDates = g.selectedDates.filter((function (e) {
                            return Z(e)
                        })), g.selectedDates.length || "min" !== e || E(i), be()), g.daysContainer && (ae(), void 0 !== i ? g.currentYearElement[e] = i.getFullYear().toString() : g.currentYearElement.removeAttribute(e), g.currentYearElement.disabled = !!n && void 0 !== i && n.getFullYear() === i.getFullYear())
                    }
                }

                function oe() {
                    "object" != typeof g.config.locale && void 0 === k.l10ns[g.config.locale] && g.config.errorHandler(new Error("flatpickr: invalid locale " + g.config.locale)), g.l10n = e({}, k.l10ns.default, "object" == typeof g.config.locale ? g.config.locale : "default" !== g.config.locale ? k.l10ns[g.config.locale] : void 0), f.K = "(" + g.l10n.amPM[0] + "|" + g.l10n.amPM[1] + "|" + g.l10n.amPM[0].toLowerCase() + "|" + g.l10n.amPM[1].toLowerCase() + ")", void 0 === e({}, m, JSON.parse(JSON.stringify(h.dataset || {}))).time_24hr && void 0 === k.defaultConfig.time_24hr && (g.config.time_24hr = g.l10n.time_24hr), g.formatDate = b(g), g.parseDate = v({
                        config: g.config,
                        l10n: g.l10n
                    })
                }

                function re(e) {
                    if (void 0 !== g.calendarContainer) {
                        he("onPreCalendarPosition");
                        var t = e || g._positionElement,
                            i = Array.prototype.reduce.call(g.calendarContainer.children, (function (e, t) {
                                return e + t.offsetHeight
                            }), 0), n = g.calendarContainer.offsetWidth, o = g.config.position.split(" "), r = o[0],
                            a = o.length > 1 ? o[1] : null, s = t.getBoundingClientRect(),
                            l = window.innerHeight - s.bottom, d = "above" === r || "below" !== r && l < i && s.top > i,
                            u = window.pageYOffset + s.top + (d ? -i - 2 : t.offsetHeight + 2);
                        if (c(g.calendarContainer, "arrowTop", !d), c(g.calendarContainer, "arrowBottom", d), !g.config.inline) {
                            var h = window.pageXOffset + s.left - (null != a && "center" === a ? (n - s.width) / 2 : 0),
                                p = window.document.body.offsetWidth - (window.pageXOffset + s.right),
                                m = h + n > window.document.body.offsetWidth,
                                f = p + n > window.document.body.offsetWidth;
                            if (c(g.calendarContainer, "rightMost", m), !g.config.static) if (g.calendarContainer.style.top = u + "px", m) if (f) {
                                var b = document.styleSheets[0];
                                if (void 0 === b) return;
                                var v = window.document.body.offsetWidth, _ = Math.max(0, v / 2 - n / 2),
                                    w = b.cssRules.length, y = "{left:" + s.left + "px;right:auto;}";
                                c(g.calendarContainer, "rightMost", !1), c(g.calendarContainer, "centerMost", !0), b.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after" + y, w), g.calendarContainer.style.left = _ + "px", g.calendarContainer.style.right = "auto"
                            } else g.calendarContainer.style.left = "auto", g.calendarContainer.style.right = p + "px"; else g.calendarContainer.style.left = h + "px", g.calendarContainer.style.right = "auto"
                        }
                    }
                }

                function ae() {
                    g.config.noCalendar || g.isMobile || (fe(), F())
                }

                function se() {
                    g._input.focus(), -1 !== window.navigator.userAgent.indexOf("MSIE") || void 0 !== navigator.msMaxTouchPoints ? setTimeout(g.close, 0) : g.close()
                }

                function ce(e) {
                    e.preventDefault(), e.stopPropagation();
                    var t = function e(t, i) {
                        return i(t) ? t : t.parentNode ? e(t.parentNode, i) : void 0
                    }(e.target, (function (e) {
                        return e.classList && e.classList.contains("flatpickr-day") && !e.classList.contains("flatpickr-disabled") && !e.classList.contains("notAllowed")
                    }));
                    if (void 0 !== t) {
                        var i = t, n = g.latestSelectedDateObj = new Date(i.dateObj.getTime()),
                            o = (n.getMonth() < g.currentMonth || n.getMonth() > g.currentMonth + g.config.showMonths - 1) && "range" !== g.config.mode;
                        if (g.selectedDateElem = i, "single" === g.config.mode) g.selectedDates = [n]; else if ("multiple" === g.config.mode) {
                            var r = me(n);
                            r ? g.selectedDates.splice(parseInt(r), 1) : g.selectedDates.push(n)
                        } else "range" === g.config.mode && (2 === g.selectedDates.length && g.clear(!1, !1), g.latestSelectedDateObj = n, g.selectedDates.push(n), 0 !== _(n, g.selectedDates[0], !0) && g.selectedDates.sort((function (e, t) {
                            return e.getTime() - t.getTime()
                        })));
                        if (C(), o) {
                            var a = g.currentYear !== n.getFullYear();
                            g.currentYear = n.getFullYear(), g.currentMonth = n.getMonth(), a && (he("onYearChange"), V()), he("onMonthChange")
                        }
                        if (fe(), F(), be(), g.config.enableTime && setTimeout((function () {
                            return g.showTimeInput = !0
                        }), 50), o || "range" === g.config.mode || 1 !== g.config.showMonths ? void 0 !== g.selectedDateElem && void 0 === g.hourElement && g.selectedDateElem && g.selectedDateElem.focus() : O(i), void 0 !== g.hourElement && void 0 !== g.hourElement && g.hourElement.focus(), g.config.closeOnSelect) {
                            var s = "single" === g.config.mode && !g.config.enableTime,
                                c = "range" === g.config.mode && 2 === g.selectedDates.length && !g.config.enableTime;
                            (s || c) && se()
                        }
                        A()
                    }
                }

                g.parseDate = v({
                    config: g.config,
                    l10n: g.l10n
                }), g._handlers = [], g.pluginElements = [], g.loadedPlugins = [], g._bind = D, g._setHoursFromDate = E, g._positionCalendar = re, g.changeMonth = Y, g.changeYear = K, g.clear = function (e, t) {
                    void 0 === e && (e = !0), void 0 === t && (t = !0), g.input.value = "", void 0 !== g.altInput && (g.altInput.value = ""), void 0 !== g.mobileInput && (g.mobileInput.value = ""), g.selectedDates = [], g.latestSelectedDateObj = void 0, !0 === t && (g.currentYear = g._initialDate.getFullYear(), g.currentMonth = g._initialDate.getMonth()), g.showTimeInput = !1, !0 === g.config.enableTime && T(), g.redraw(), e && he("onChange")
                }, g.close = function () {
                    g.isOpen = !1, g.isMobile || (void 0 !== g.calendarContainer && g.calendarContainer.classList.remove("open"), void 0 !== g._input && g._input.classList.remove("active")), he("onClose")
                }, g._createElement = l, g.destroy = function () {
                    void 0 !== g.config && he("onDestroy");
                    for (var e = g._handlers.length; e--;) {
                        var t = g._handlers[e];
                        t.element.removeEventListener(t.event, t.handler, t.options)
                    }
                    if (g._handlers = [], g.mobileInput) g.mobileInput.parentNode && g.mobileInput.parentNode.removeChild(g.mobileInput), g.mobileInput = void 0; else if (g.calendarContainer && g.calendarContainer.parentNode) if (g.config.static && g.calendarContainer.parentNode) {
                        var i = g.calendarContainer.parentNode;
                        if (i.lastChild && i.removeChild(i.lastChild), i.parentNode) {
                            for (; i.firstChild;) i.parentNode.insertBefore(i.firstChild, i);
                            i.parentNode.removeChild(i)
                        }
                    } else g.calendarContainer.parentNode.removeChild(g.calendarContainer);
                    g.altInput && (g.input.type = "text", g.altInput.parentNode && g.altInput.parentNode.removeChild(g.altInput), delete g.altInput), g.input && (g.input.type = g.input._type, g.input.classList.remove("flatpickr-input"), g.input.removeAttribute("readonly"), g.input.value = ""), ["_showTimeInput", "latestSelectedDateObj", "_hideNextMonthArrow", "_hidePrevMonthArrow", "__hideNextMonthArrow", "__hidePrevMonthArrow", "isMobile", "isOpen", "selectedDateElem", "minDateHasTime", "maxDateHasTime", "days", "daysContainer", "_input", "_positionElement", "innerContainer", "rContainer", "monthNav", "todayDateElem", "calendarContainer", "weekdayContainer", "prevMonthNav", "nextMonthNav", "monthsDropdownContainer", "currentMonthElement", "currentYearElement", "navigationCurrentMonth", "selectedDateElem", "config"].forEach((function (e) {
                        try {
                            delete g[e]
                        } catch (e) {
                        }
                    }))
                }, g.isEnabled = Z, g.jumpToDate = L, g.open = function (e, t) {
                    if (void 0 === t && (t = g._positionElement), !0 === g.isMobile) return e && (e.preventDefault(), e.target && e.target.blur()), void 0 !== g.mobileInput && (g.mobileInput.focus(), g.mobileInput.click()), void he("onOpen");
                    if (!g._input.disabled && !g.config.inline) {
                        var i = g.isOpen;
                        g.isOpen = !0, i || (g.calendarContainer.classList.add("open"), g._input.classList.add("active"), he("onOpen"), re(t)), !0 === g.config.enableTime && !0 === g.config.noCalendar && (0 === g.selectedDates.length && ie(), !1 !== g.config.allowInput || void 0 !== e && g.timeContainer.contains(e.relatedTarget) || setTimeout((function () {
                            return g.hourElement.select()
                        }), 50))
                    }
                }, g.redraw = ae, g.set = function (e, i) {
                    if (null !== e && "object" == typeof e) for (var n in Object.assign(g.config, e), e) void 0 !== le[n] && le[n].forEach((function (e) {
                        return e()
                    })); else g.config[e] = i, void 0 !== le[e] ? le[e].forEach((function (e) {
                        return e()
                    })) : t.indexOf(e) > -1 && (g.config[e] = s(i));
                    g.redraw(), be(!1)
                }, g.setDate = function (e, t, i) {
                    if (void 0 === t && (t = !1), void 0 === i && (i = g.config.dateFormat), 0 !== e && !e || e instanceof Array && 0 === e.length) return g.clear(t);
                    de(e, i), g.showTimeInput = g.selectedDates.length > 0, g.latestSelectedDateObj = g.selectedDates[g.selectedDates.length - 1], g.redraw(), L(), E(), 0 === g.selectedDates.length && g.clear(!1), be(t), t && he("onChange")
                }, g.toggle = function (e) {
                    if (!0 === g.isOpen) return g.close();
                    g.open(e)
                };
                var le = {locale: [oe, W], showMonths: [q, x, B], minDate: [L], maxDate: [L]};

                function de(e, t) {
                    var i = [];
                    if (e instanceof Array) i = e.map((function (e) {
                        return g.parseDate(e, t)
                    })); else if (e instanceof Date || "number" == typeof e) i = [g.parseDate(e, t)]; else if ("string" == typeof e) switch (g.config.mode) {
                        case"single":
                        case"time":
                            i = [g.parseDate(e, t)];
                            break;
                        case"multiple":
                            i = e.split(g.config.conjunction).map((function (e) {
                                return g.parseDate(e, t)
                            }));
                            break;
                        case"range":
                            i = e.split(g.l10n.rangeSeparator).map((function (e) {
                                return g.parseDate(e, t)
                            }))
                    } else g.config.errorHandler(new Error("Invalid date supplied: " + JSON.stringify(e)));
                    g.selectedDates = i.filter((function (e) {
                        return e instanceof Date && Z(e, !1)
                    })), "range" === g.config.mode && g.selectedDates.sort((function (e, t) {
                        return e.getTime() - t.getTime()
                    }))
                }

                function ue(e) {
                    return e.slice().map((function (e) {
                        return "string" == typeof e || "number" == typeof e || e instanceof Date ? g.parseDate(e, void 0, !0) : e && "object" == typeof e && e.from && e.to ? {
                            from: g.parseDate(e.from, void 0),
                            to: g.parseDate(e.to, void 0)
                        } : e
                    })).filter((function (e) {
                        return e
                    }))
                }

                function he(e, t) {
                    if (void 0 !== g.config) {
                        var i = g.config[e];
                        if (void 0 !== i && i.length > 0) for (var n = 0; i[n] && n < i.length; n++) i[n](g.selectedDates, g.input.value, g, t);
                        "onChange" === e && (g.input.dispatchEvent(pe("change")), g.input.dispatchEvent(pe("input")))
                    }
                }

                function pe(e) {
                    var t = document.createEvent("Event");
                    return t.initEvent(e, !0, !0), t
                }

                function me(e) {
                    for (var t = 0; t < g.selectedDates.length; t++) if (0 === _(g.selectedDates[t], e)) return "" + t;
                    return !1
                }

                function fe() {
                    g.config.noCalendar || g.isMobile || !g.monthNav || (g.yearElements.forEach((function (e, t) {
                        var i = new Date(g.currentYear, g.currentMonth, 1);
                        i.setMonth(g.currentMonth + t), g.config.showMonths > 1 || "static" === g.config.monthSelectorType ? g.monthElements[t].textContent = p(i.getMonth(), g.config.shorthandCurrentMonth, g.l10n) + " " : g.monthsDropdownContainer.value = i.getMonth().toString(), e.value = i.getFullYear().toString()
                    })), g._hidePrevMonthArrow = void 0 !== g.config.minDate && (g.currentYear === g.config.minDate.getFullYear() ? g.currentMonth <= g.config.minDate.getMonth() : g.currentYear < g.config.minDate.getFullYear()), g._hideNextMonthArrow = void 0 !== g.config.maxDate && (g.currentYear === g.config.maxDate.getFullYear() ? g.currentMonth + 1 > g.config.maxDate.getMonth() : g.currentYear > g.config.maxDate.getFullYear()))
                }

                function ge(e) {
                    return g.selectedDates.map((function (t) {
                        return g.formatDate(t, e)
                    })).filter((function (e, t, i) {
                        return "range" !== g.config.mode || g.config.enableTime || i.indexOf(e) === t
                    })).join("range" !== g.config.mode ? g.config.conjunction : g.l10n.rangeSeparator)
                }

                function be(e) {
                    void 0 === e && (e = !0), void 0 !== g.mobileInput && g.mobileFormatStr && (g.mobileInput.value = void 0 !== g.latestSelectedDateObj ? g.formatDate(g.latestSelectedDateObj, g.mobileFormatStr) : ""), g.input.value = ge(g.config.dateFormat), void 0 !== g.altInput && (g.altInput.value = ge(g.config.altFormat)), !1 !== e && he("onValueUpdate")
                }

                function ve(e) {
                    var t = g.prevMonthNav.contains(e.target), i = g.nextMonthNav.contains(e.target);
                    t || i ? Y(t ? -1 : 1) : g.yearElements.indexOf(e.target) >= 0 ? e.target.select() : e.target.classList.contains("arrowUp") ? g.changeYear(g.currentYear + 1) : e.target.classList.contains("arrowDown") && g.changeYear(g.currentYear - 1)
                }

                return function () {
                    g.element = g.input = h, g.isOpen = !1, function () {
                        var n = ["wrap", "weekNumbers", "allowInput", "clickOpens", "time_24hr", "enableTime", "noCalendar", "altInput", "shorthandCurrentMonth", "inline", "static", "enableSeconds", "disableMobile"],
                            o = e({}, m, JSON.parse(JSON.stringify(h.dataset || {}))), r = {};
                        g.config.parseDate = o.parseDate, g.config.formatDate = o.formatDate, Object.defineProperty(g.config, "enable", {
                            get: function () {
                                return g.config._enable
                            }, set: function (e) {
                                g.config._enable = ue(e)
                            }
                        }), Object.defineProperty(g.config, "disable", {
                            get: function () {
                                return g.config._disable
                            }, set: function (e) {
                                g.config._disable = ue(e)
                            }
                        });
                        var a = "time" === o.mode;
                        if (!o.dateFormat && (o.enableTime || a)) {
                            var c = k.defaultConfig.dateFormat || i.dateFormat;
                            r.dateFormat = o.noCalendar || a ? "H:i" + (o.enableSeconds ? ":S" : "") : c + " H:i" + (o.enableSeconds ? ":S" : "")
                        }
                        if (o.altInput && (o.enableTime || a) && !o.altFormat) {
                            var l = k.defaultConfig.altFormat || i.altFormat;
                            r.altFormat = o.noCalendar || a ? "h:i" + (o.enableSeconds ? ":S K" : " K") : l + " h:i" + (o.enableSeconds ? ":S" : "") + " K"
                        }
                        o.altInputClass || (g.config.altInputClass = g.input.className + " " + g.config.altInputClass), Object.defineProperty(g.config, "minDate", {
                            get: function () {
                                return g.config._minDate
                            }, set: ne("min")
                        }), Object.defineProperty(g.config, "maxDate", {
                            get: function () {
                                return g.config._maxDate
                            }, set: ne("max")
                        });
                        var d = function (e) {
                            return function (t) {
                                g.config["min" === e ? "_minTime" : "_maxTime"] = g.parseDate(t, "H:i:S")
                            }
                        };
                        Object.defineProperty(g.config, "minTime", {
                            get: function () {
                                return g.config._minTime
                            }, set: d("min")
                        }), Object.defineProperty(g.config, "maxTime", {
                            get: function () {
                                return g.config._maxTime
                            }, set: d("max")
                        }), "time" === o.mode && (g.config.noCalendar = !0, g.config.enableTime = !0), Object.assign(g.config, r, o);
                        for (var u = 0; u < n.length; u++) g.config[n[u]] = !0 === g.config[n[u]] || "true" === g.config[n[u]];
                        for (t.filter((function (e) {
                            return void 0 !== g.config[e]
                        })).forEach((function (e) {
                            g.config[e] = s(g.config[e] || []).map(y)
                        })), g.isMobile = !g.config.disableMobile && !g.config.inline && "single" === g.config.mode && !g.config.disable.length && !g.config.enable.length && !g.config.weekNumbers && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), u = 0; u < g.config.plugins.length; u++) {
                            var p = g.config.plugins[u](g) || {};
                            for (var f in p) t.indexOf(f) > -1 ? g.config[f] = s(p[f]).map(y).concat(g.config[f]) : void 0 === o[f] && (g.config[f] = p[f])
                        }
                        he("onParseConfig")
                    }(), oe(), g.input = g.config.wrap ? h.querySelector("[data-input]") : h, g.input ? (g.input._type = g.input.type, g.input.type = "text", g.input.classList.add("flatpickr-input"), g._input = g.input, g.config.altInput && (g.altInput = l(g.input.nodeName, g.config.altInputClass), g._input = g.altInput, g.altInput.placeholder = g.input.placeholder, g.altInput.disabled = g.input.disabled, g.altInput.required = g.input.required, g.altInput.tabIndex = g.input.tabIndex, g.altInput.type = "text", g.input.setAttribute("type", "hidden"), !g.config.static && g.input.parentNode && g.input.parentNode.insertBefore(g.altInput, g.input.nextSibling)), g.config.allowInput || g._input.setAttribute("readonly", "readonly"), g._positionElement = g.config.positionElement || g._input) : g.config.errorHandler(new Error("Invalid input element specified")), function () {
                        g.selectedDates = [], g.now = g.parseDate(g.config.now) || new Date;
                        var e = g.config.defaultDate || ("INPUT" !== g.input.nodeName && "TEXTAREA" !== g.input.nodeName || !g.input.placeholder || g.input.value !== g.input.placeholder ? g.input.value : null);
                        e && de(e, g.config.dateFormat), g._initialDate = g.selectedDates.length > 0 ? g.selectedDates[0] : g.config.minDate && g.config.minDate.getTime() > g.now.getTime() ? g.config.minDate : g.config.maxDate && g.config.maxDate.getTime() < g.now.getTime() ? g.config.maxDate : g.now, g.currentYear = g._initialDate.getFullYear(), g.currentMonth = g._initialDate.getMonth(), g.selectedDates.length > 0 && (g.latestSelectedDateObj = g.selectedDates[0]), void 0 !== g.config.minTime && (g.config.minTime = g.parseDate(g.config.minTime, "H:i")), void 0 !== g.config.maxTime && (g.config.maxTime = g.parseDate(g.config.maxTime, "H:i")), g.minDateHasTime = !!g.config.minDate && (g.config.minDate.getHours() > 0 || g.config.minDate.getMinutes() > 0 || g.config.minDate.getSeconds() > 0), g.maxDateHasTime = !!g.config.maxDate && (g.config.maxDate.getHours() > 0 || g.config.maxDate.getMinutes() > 0 || g.config.maxDate.getSeconds() > 0), Object.defineProperty(g, "showTimeInput", {
                            get: function () {
                                return g._showTimeInput
                            }, set: function (e) {
                                g._showTimeInput = e, g.calendarContainer && c(g.calendarContainer, "showTimeInput", e), g.isOpen && re()
                            }
                        })
                    }(), g.utils = {
                        getDaysInMonth: function (e, t) {
                            return void 0 === e && (e = g.currentMonth), void 0 === t && (t = g.currentYear), 1 === e && (t % 4 == 0 && t % 100 != 0 || t % 400 == 0) ? 29 : g.l10n.daysInMonth[e]
                        }
                    }, g.isMobile || function () {
                        var e = window.document.createDocumentFragment();
                        if (g.calendarContainer = l("div", "flatpickr-calendar"), g.calendarContainer.tabIndex = -1, !g.config.noCalendar) {
                            if (e.appendChild((g.monthNav = l("div", "flatpickr-months"), g.yearElements = [], g.monthElements = [], g.prevMonthNav = l("span", "flatpickr-prev-month"), g.prevMonthNav.innerHTML = g.config.prevArrow, g.nextMonthNav = l("span", "flatpickr-next-month"), g.nextMonthNav.innerHTML = g.config.nextArrow, q(), Object.defineProperty(g, "_hidePrevMonthArrow", {
                                get: function () {
                                    return g.__hidePrevMonthArrow
                                }, set: function (e) {
                                    g.__hidePrevMonthArrow !== e && (c(g.prevMonthNav, "flatpickr-disabled", e), g.__hidePrevMonthArrow = e)
                                }
                            }), Object.defineProperty(g, "_hideNextMonthArrow", {
                                get: function () {
                                    return g.__hideNextMonthArrow
                                }, set: function (e) {
                                    g.__hideNextMonthArrow !== e && (c(g.nextMonthNav, "flatpickr-disabled", e), g.__hideNextMonthArrow = e)
                                }
                            }), g.currentYearElement = g.yearElements[0], fe(), g.monthNav)), g.innerContainer = l("div", "flatpickr-innerContainer"), g.config.weekNumbers) {
                                var t = function () {
                                    g.calendarContainer.classList.add("hasWeeks");
                                    var e = l("div", "flatpickr-weekwrapper");
                                    e.appendChild(l("span", "flatpickr-weekday", g.l10n.weekAbbreviation));
                                    var t = l("div", "flatpickr-weeks");
                                    return e.appendChild(t), {weekWrapper: e, weekNumbers: t}
                                }(), i = t.weekWrapper, n = t.weekNumbers;
                                g.innerContainer.appendChild(i), g.weekNumbers = n, g.weekWrapper = i
                            }
                            g.rContainer = l("div", "flatpickr-rContainer"), g.rContainer.appendChild(B()), g.daysContainer || (g.daysContainer = l("div", "flatpickr-days"), g.daysContainer.tabIndex = -1), F(), g.rContainer.appendChild(g.daysContainer), g.innerContainer.appendChild(g.rContainer), e.appendChild(g.innerContainer)
                        }
                        g.config.enableTime && e.appendChild(function () {
                            g.calendarContainer.classList.add("hasTime"), g.config.noCalendar && g.calendarContainer.classList.add("noCalendar"), g.timeContainer = l("div", "flatpickr-time"), g.timeContainer.tabIndex = -1;
                            var e = l("span", "flatpickr-time-separator", ":"),
                                t = u("flatpickr-hour", {"aria-label": g.l10n.hourAriaLabel});
                            g.hourElement = t.getElementsByTagName("input")[0];
                            var i = u("flatpickr-minute", {"aria-label": g.l10n.minuteAriaLabel});
                            if (g.minuteElement = i.getElementsByTagName("input")[0], g.hourElement.tabIndex = g.minuteElement.tabIndex = -1, g.hourElement.value = o(g.latestSelectedDateObj ? g.latestSelectedDateObj.getHours() : g.config.time_24hr ? g.config.defaultHour : function (e) {
                                switch (e % 24) {
                                    case 0:
                                    case 12:
                                        return 12;
                                    default:
                                        return e % 12
                                }
                            }(g.config.defaultHour)), g.minuteElement.value = o(g.latestSelectedDateObj ? g.latestSelectedDateObj.getMinutes() : g.config.defaultMinute), g.hourElement.setAttribute("step", g.config.hourIncrement.toString()), g.minuteElement.setAttribute("step", g.config.minuteIncrement.toString()), g.hourElement.setAttribute("min", g.config.time_24hr ? "0" : "1"), g.hourElement.setAttribute("max", g.config.time_24hr ? "23" : "12"), g.minuteElement.setAttribute("min", "0"), g.minuteElement.setAttribute("max", "59"), g.timeContainer.appendChild(t), g.timeContainer.appendChild(e), g.timeContainer.appendChild(i), g.config.time_24hr && g.timeContainer.classList.add("time24hr"), g.config.enableSeconds) {
                                g.timeContainer.classList.add("hasSeconds");
                                var n = u("flatpickr-second");
                                g.secondElement = n.getElementsByTagName("input")[0], g.secondElement.value = o(g.latestSelectedDateObj ? g.latestSelectedDateObj.getSeconds() : g.config.defaultSeconds), g.secondElement.setAttribute("step", g.minuteElement.getAttribute("step")), g.secondElement.setAttribute("min", "0"), g.secondElement.setAttribute("max", "59"), g.timeContainer.appendChild(l("span", "flatpickr-time-separator", ":")), g.timeContainer.appendChild(n)
                            }
                            return g.config.time_24hr || (g.amPM = l("span", "flatpickr-am-pm", g.l10n.amPM[r((g.latestSelectedDateObj ? g.hourElement.value : g.config.defaultHour) > 11)]), g.amPM.title = g.l10n.toggleTitle, g.amPM.tabIndex = -1, g.timeContainer.appendChild(g.amPM)), g.timeContainer
                        }()), c(g.calendarContainer, "rangeMode", "range" === g.config.mode), c(g.calendarContainer, "animate", !0 === g.config.animate), c(g.calendarContainer, "multiMonth", g.config.showMonths > 1), g.calendarContainer.appendChild(e);
                        var a = void 0 !== g.config.appendTo && void 0 !== g.config.appendTo.nodeType;
                        if ((g.config.inline || g.config.static) && (g.calendarContainer.classList.add(g.config.inline ? "inline" : "static"), g.config.inline && (!a && g.element.parentNode ? g.element.parentNode.insertBefore(g.calendarContainer, g._input.nextSibling) : void 0 !== g.config.appendTo && g.config.appendTo.appendChild(g.calendarContainer)), g.config.static)) {
                            var s = l("div", "flatpickr-wrapper");
                            g.element.parentNode && g.element.parentNode.insertBefore(s, g.element), s.appendChild(g.element), g.altInput && s.appendChild(g.altInput), s.appendChild(g.calendarContainer)
                        }
                        g.config.static || g.config.inline || (void 0 !== g.config.appendTo ? g.config.appendTo : window.document.body).appendChild(g.calendarContainer)
                    }(), function () {
                        if (g.config.wrap && ["open", "close", "toggle", "clear"].forEach((function (e) {
                            Array.prototype.forEach.call(g.element.querySelectorAll("[data-" + e + "]"), (function (t) {
                                return D(t, "click", g[e])
                            }))
                        })), g.isMobile) !function () {
                            var e = g.config.enableTime ? g.config.noCalendar ? "time" : "datetime-local" : "date";
                            g.mobileInput = l("input", g.input.className + " flatpickr-mobile"), g.mobileInput.step = g.input.getAttribute("step") || "any", g.mobileInput.tabIndex = 1, g.mobileInput.type = e, g.mobileInput.disabled = g.input.disabled, g.mobileInput.required = g.input.required, g.mobileInput.placeholder = g.input.placeholder, g.mobileFormatStr = "datetime-local" === e ? "Y-m-d\\TH:i:S" : "date" === e ? "Y-m-d" : "H:i:S", g.selectedDates.length > 0 && (g.mobileInput.defaultValue = g.mobileInput.value = g.formatDate(g.selectedDates[0], g.mobileFormatStr)), g.config.minDate && (g.mobileInput.min = g.formatDate(g.config.minDate, "Y-m-d")), g.config.maxDate && (g.mobileInput.max = g.formatDate(g.config.maxDate, "Y-m-d")), g.input.type = "hidden", void 0 !== g.altInput && (g.altInput.type = "hidden");
                            try {
                                g.input.parentNode && g.input.parentNode.insertBefore(g.mobileInput, g.input.nextSibling)
                            } catch (e) {
                            }
                            D(g.mobileInput, "change", (function (e) {
                                g.setDate(e.target.value, !1, g.mobileFormatStr), he("onChange"), he("onClose")
                            }))
                        }(); else {
                            var e = a(te, 50);
                            g._debouncedChange = a(A, 300), g.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent) && D(g.daysContainer, "mouseover", (function (e) {
                                "range" === g.config.mode && ee(e.target)
                            })), D(window.document.body, "keydown", Q), g.config.inline || g.config.static || D(window, "resize", e), void 0 !== window.ontouchstart ? D(window.document, "touchstart", J) : D(window.document, "mousedown", I(J)), D(window.document, "focus", J, {capture: !0}), !0 === g.config.clickOpens && (D(g._input, "focus", g.open), D(g._input, "mousedown", I(g.open))), void 0 !== g.daysContainer && (D(g.monthNav, "mousedown", I(ve)), D(g.monthNav, ["keyup", "increment"], P), D(g.daysContainer, "mousedown", I(ce))), void 0 !== g.timeContainer && void 0 !== g.minuteElement && void 0 !== g.hourElement && (D(g.timeContainer, ["increment"], S), D(g.timeContainer, "blur", S, {capture: !0}), D(g.timeContainer, "mousedown", I(N)), D([g.hourElement, g.minuteElement], ["focus", "click"], (function (e) {
                                return e.target.select()
                            })), void 0 !== g.secondElement && D(g.secondElement, "focus", (function () {
                                return g.secondElement && g.secondElement.select()
                            })), void 0 !== g.amPM && D(g.amPM, "mousedown", I((function (e) {
                                S(e), A()
                            }))))
                        }
                    }(), (g.selectedDates.length || g.config.noCalendar) && (g.config.enableTime && E(g.config.noCalendar ? g.latestSelectedDateObj || g.config.minDate : void 0), be(!1)), x(), g.showTimeInput = g.selectedDates.length > 0 || g.config.noCalendar;
                    var n = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
                    !g.isMobile && n && re(), he("onReady")
                }(), g
            }

            function x(e, t) {
                for (var i = Array.prototype.slice.call(e).filter((function (e) {
                    return e instanceof HTMLElement
                })), n = [], o = 0; o < i.length; o++) {
                    var r = i[o];
                    try {
                        if (null !== r.getAttribute("data-fp-omit")) continue;
                        void 0 !== r._flatpickr && (r._flatpickr.destroy(), r._flatpickr = void 0), r._flatpickr = y(r, t || {}), n.push(r._flatpickr)
                    } catch (e) {
                        console.error(e)
                    }
                }
                return 1 === n.length ? n[0] : n
            }

            "function" != typeof Object.assign && (Object.assign = function (e) {
                for (var t = [], i = 1; i < arguments.length; i++) t[i - 1] = arguments[i];
                if (!e) throw TypeError("Cannot convert undefined or null to object");
                for (var n = function (t) {
                    t && Object.keys(t).forEach((function (i) {
                        return e[i] = t[i]
                    }))
                }, o = 0, r = t; o < r.length; o++) {
                    var a = r[o];
                    n(a)
                }
                return e
            }), "undefined" != typeof HTMLElement && "undefined" != typeof HTMLCollection && "undefined" != typeof NodeList && (HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function (e) {
                return x(this, e)
            }, HTMLElement.prototype.flatpickr = function (e) {
                return x([this], e)
            });
            var k = function (e, t) {
                return "string" == typeof e ? x(window.document.querySelectorAll(e), t) : e instanceof Node ? x([e], t) : x(e, t)
            };
            return k.defaultConfig = {}, k.l10ns = {en: e({}, n), default: e({}, n)}, k.localize = function (t) {
                k.l10ns.default = e({}, k.l10ns.default, t)
            }, k.setDefaults = function (t) {
                k.defaultConfig = e({}, k.defaultConfig, t)
            }, k.parseDate = v({}), k.formatDate = b({}), k.compareDates = _, "undefined" != typeof jQuery && void 0 !== jQuery.fn && (jQuery.fn.flatpickr = function (e) {
                return x(this, e)
            }), Date.prototype.fp_incr = function (e) {
                return new Date(this.getFullYear(), this.getMonth(), this.getDate() + ("string" == typeof e ? parseInt(e, 10) : e))
            }, "undefined" != typeof window && (window.flatpickr = k), k
        }()
    }));
    window.customElements.define("ion-datetime", class extends ie {
        static get styles() {
            return [En, ee`:host{display:block;box-sizing:border-box}`]
        }

        static get properties() {
            return {
                label: {type: String},
                value: {type: String},
                min: {type: String},
                max: {type: String},
                default: {type: String},
                readonly: {type: Boolean},
                disabled: {type: Boolean}
            }
        }

        constructor() {
            super(), this.label = "", this.readonly = !1, this.disabled = !1, this._min = "", this._max = "", this._value = "", this._elementId = `ion-${e.createGuid()}`
        }

        get value() {
            return this._value
        }

        set value(t) {
            e.defined(this._flatpickr) && this._flatpickr.setDate(t), this._value = t
        }

        get min() {
            return this._min
        }

        set min(t) {
            e.defined(this._flatpickr) && this._flatpickr.set("minDate", t), this._min = t
        }

        get max() {
            return this._max
        }

        set max(t) {
            e.defined(this._flatpickr) && this._flatpickr.set("maxDate", t), this._max = t
        }

        firstUpdated() {
            const e = this.shadowRoot.querySelector(`#${this._elementId}`);
            this._flatpickr = Uo(e, {
                minDate: this.min,
                maxDate: this.max,
                defaultDate: this._value,
                disableMobile: "true",
                enableTime: !0,
                enableSeconds: !0,
                dateFormat: "M d Y G:i:S K",
                onChange: this._onChange.bind(this)
            })
        }

        _onChange(e) {
            const t = e[0].toISOString();
            this._value !== t && (this._value = t, this.dispatchEvent(new CustomEvent("input", {detail: {value: this._value}})))
        }

        render() {
            return z`${"" !== this.label ? z`<label for="${this._elementId}">${this.label}</label>` : ""} <input class="ion-form-input" type="text" id="${this._elementId}" ?readonly="${this.readonly}" ?disabled="${this.disabled}">`
        }
    });
    customElements.define("ion-context-menu", class extends ie {
        static get properties() {
            return {_open: {type: Boolean, reflect: !0}}
        }

        static get styles() {
            return [Ri, ee`:host{display:none;z-index:10;position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none}.popover-wrapper{background-color:var(--container-bg);border-radius:var(--border-radius);position:absolute;box-shadow:0 0 10px var(--shadow-color);max-height:90%;overflow-y:auto}:host([_open]){display:inline-block}:host([_open]) .popover-wrapper{pointer-events:all}`]
        }

        constructor() {
            super(), this._open = !1, this.top = 0, this.left = 0, this._closeDropdown = this._closeDropdown.bind(this)
        }

        firstUpdated() {
            this.addEventListener("click", e => {
                e.stopPropagation()
            }), this.addEventListener("pointerdown", e => {
                e.stopPropagation()
            }), this.addEventListener("pointerup", e => {
                e.stopPropagation()
            })
        }

        render() {
            const e = `top: ${this.top}px; left: ${this.left}px`;
            return z`<div class="popover-wrapper" style="${e}"><slot></slot></div>`
        }

        _closeDropdown(t) {
            e.defined(t) && -1 !== t.composedPath().indexOf(this) || this.close()
        }

        open(e, t) {
            this.left = e, this.top = t, this._open = !0, document.addEventListener("pointerdown", this._closeDropdown), document.addEventListener("wheel", this._closeDropdown)
        }

        close() {
            this._open = !1, document.removeEventListener("pointerdown", this._closeDropdown), document.removeEventListener("wheel", this._closeDropdown)
        }
    });

    class jo extends (ne(dt)(ie)) {
        static get styles() {
            return [Ri, ee`:host{display:flex;flex-direction:column;width:100%;overflow-y:auto}.slide-tile-row{padding:.4rem 1rem;border-top:2px solid transparent}.slide-tile-row:last-child{border-bottom:2px solid transparent}.slide-tile-row.active{background-color:var(--brand-primary-tint)}.slide-tile-row.active>.slide-tile{border-color:var(--brand-primary)}.slide-tile-row.drag-before{border-top:2px solid var(--brand-primary)}.slide-tile-row.drag-after+.slide-tile-row{border-top:2px solid var(--brand-primary)}.slide-tile-row.drag-after:last-child{border-bottom:2px solid var(--brand-primary)}.slide-tile{cursor:pointer;border-radius:var(--border-radius);overflow:hidden;transition:box-shadow var(--transition-time) ease-out,border-color var(--transition-time) ease-out;border:2px solid transparent;position:relative}.slide-tile:hover{box-shadow:0 0 10px var(--shadow-color);border-color:rgba(45,58,66,.4)}.slide-tile-inner{background-color:var(--container-bg)}.slide-tile img{display:block;width:100%}.slide-tile .name{padding:.25rem;text-align:center}#dragContainer{position:absolute;top:-50px;height:25px}.delete-menu-item{background-color:var(--container-bg);padding:.5rem 1rem;cursor:pointer}.delete-menu-item:hover{background-color:var(--brand-danger-bg)}.delete-menu-item svg{height:1rem;width:1rem}`]
        }

        static get properties() {
            return {slides: {type: Object}, currentIndex: {type: Number}}
        }

        constructor() {
            super(), this._slides = {
                byId: {},
                ids: []
            }, this._contextMenuIndex = 0, this._openMenu = this._openMenu.bind(this), this._currentIndex = 0
        }

        get slides() {
            return this._slides
        }

        set slides(e) {
            this._slides = e, this.requestUpdate()
        }

        get currentIndex() {
            return this._currentIndex
        }

        set currentIndex(e) {
            this._currentIndex = e, this.requestUpdate(), this.updateComplete.then(() => {
                const t = this.shadowRoot.querySelector(`#slide${e}`);
                if (null !== t) {
                    const e = this.shadowRoot.host.parentElement, i = e.getBoundingClientRect(),
                        n = t.getBoundingClientRect();
                    i.top > n.top ? t.scrollIntoView() : i.bottom < n.bottom && (t.scrollIntoView(!1), e.scrollTop = e.scrollTop + 45)
                }
            })
        }

        firstUpdated() {
            const e = this.shadowRoot.getElementById("dragthing");
            e.height = 25, e.width = 95;
            const t = e.getContext("2d");
            t.fillStyle = "#2D3A42", t.fillRect(0, 0, e.width, e.height), t.fillStyle = "white", t.font = '14px "Lato", Arial', t.fillText("Move slide", 10, 17)
        }

        render() {
            return e.defined(this._slides) ? z`<cesium-draggable-list @reorder="${this._onReorder}"><div id="dragContainer" slot="dragthing"><canvas id="dragthing"></canvas></div>${this._renderSlideFrames()}</cesium-draggable-list><ion-context-menu><div class="delete-menu-item" @click="${this._deleteSlideMenuClick}"><span>${mi.node}</span> Delete slide</div></ion-context-menu>` : z``
        }

        _renderSlideFrames() {
            const t = this._slides.byId, i = this._slides.ids;
            return z`${Ro(i, e => e, (i, n) => z`<div id="slide${n}" class="slide-tile-row ${this.currentIndex === n ? " active" : ""}"><div class="slide-tile" data-slide-index="${n}" @click="${this._onSlideTileClick}" @contextmenu="${this._openMenu}"><div class="slide-tile-inner"><img class="thumbnail" src="${e.defined(t[i].thumbnail) ? t[i].thumbnail : "../../Images/home.jpg"}" draggable="false"><div class="name">${t[i].name}</div></div></div></div>`)}`
        }

        _onReorder(e) {
            const t = e.detail.oldIndex, i = e.detail.newIndex, n = this._slides.ids.slice(), o = n.splice(t, 1)[0];
            var r;
            n.splice(i, 0, o), dt.dispatch((r = n, async (e, t) => {
                const i = t(), n = i.story, o = n.id, a = n.slides.ids[i.app.activeSlideIndex], s = r.indexOf(a);
                Me(t, () => be(o, {slideIds: r}), e), e({
                    type: "UPDATE_SLIDES_ORDER",
                    slideIds: r
                }), e({type: "SET_ACTIVE_SLIDE_INDEX", index: s})
            }))
        }

        _onSlideTileClick(e) {
            const t = Number(e.currentTarget.getAttribute("data-slide-index"));
            dt.dispatch(ce(t))
        }

        _openMenu(e) {
            this._slides.ids.length <= 1 || (this._contextMenuIndex = Number(e.currentTarget.getAttribute("data-slide-index")), 2 === e.buttons && (e.preventDefault(), e.stopPropagation(), this.shadowRoot.querySelector("ion-context-menu").open(e.clientX, e.clientY)))
        }

        _deleteSlideMenuClick() {
            dt.dispatch(Ne(this._slides.ids[this._contextMenuIndex])), this.shadowRoot.querySelector("ion-context-menu").close()
        }

        stateChanged(e) {
            this.slides = e.story.slides, this.currentIndex = e.app.activeSlideIndex
        }
    }

    window.customElements.define("ion-filmstrip", jo);
    window.customElements.define("ion-number-field", class extends ie {
        static get styles() {
            return [En]
        }

        static get properties() {
            return {
                label: {type: String},
                value: {type: Number},
                readonly: {type: Boolean},
                disabled: {type: Boolean},
                min: {type: Number},
                max: {type: Number},
                step: {type: Number}
            }
        }

        constructor() {
            super(), this.label = "", this.readonly = !1, this.disabled = !1, this.min = null, this.max = null, this.step = 1, this.value = 0, this._elementId = `ion-${e.createGuid()}`
        }

        checkValidity() {
            const t = this.shadowRoot.querySelector(`#${this._elementId}`), i = t.valueAsNumber;
            return isNaN(i) || e.defined(this.min) && i < this.min || e.defined(this.max) && i > this.max ? (t.classList.add("invalid"), !1) : (t.classList.remove("invalid"), !0)
        }

        clearValidation() {
            this.shadowRoot.querySelector(`#${this._elementId}`).classList.remove("invalid")
        }

        select() {
            const t = this.shadowRoot.querySelector(`#${this._elementId}`);
            e.defined(t) && t.select()
        }

        render() {
            return z`${"" !== this.label ? z`<label for="${this._elementId}">${this.label}</label>` : ""} <input id="${this._elementId}" class="ion-form-input" type="number" .value="${this.value}" min="${this.min}" max="${this.max}" step="${this.step}" ?readonly="${this.readonly}" ?required="${this.required}" ?disabled="${this.disabled}" @focus="${this.clearValidation}" @input="${this._onInput}">`
        }

        _onInput(e) {
            this.value = e.target.value, this.dispatchEvent(new CustomEvent("input", {detail: {value: this.value}}))
        }
    });
    window.customElements.define("ion-wysiwyg-editor", class extends ie {
        static get styles() {
            return [ee`#editorFrame{height:250px;border:none;width:100%;resize:vertical;padding:0;margin:0}`]
        }

        static get properties() {
            return {value: {type: Object}}
        }

        constructor() {
            super(), this._value = ""
        }

        get value() {
            return this._value
        }

        set value(t) {
            if (this._value !== t) {
                this._value = t;
                const i = this.shadowRoot.querySelector("#editorFrame");
                e.defined(i) && i.contentWindow.postMessage({value: t}, window.location.origin, [])
            }
        }

        firstUpdated() {
            window.addEventListener("message", t => {
                const i = t.data, n = i.value;
                if (e.defined(n)) return void (JSON.stringify(this._value) !== JSON.stringify(n) && (this._value = n, this.dispatchEvent(new CustomEvent("input", {detail: {value: this._value}}))));
                const o = i.error;
                var r, a;
                e.defined(o) && dt.dispatch((r = "error", a = o, e => {
                    e({type: "SHOW_ERROR", id: r, message: a})
                }))
            }, !1)
        }

        render() {
            return z`<iframe id="editorFrame" src="components/ion-wysiwyg-editor/editor.html" @load="${this._iframeLoaded}"></iframe>`
        }

        _iframeLoaded(e) {
            e.target.contentWindow.postMessage({imageCredentialsEndpoint: `${ge}stories/imagecredentials`}, window.location.origin, []), e.target.contentWindow.postMessage({value: this._value}, window.location.origin, [])
        }
    });
    const Fo = new e.JulianDate;

    class Vo extends (ne(dt)(ie)) {
        static get styles() {
            return [Ri, ee`:host{display:flex;flex-direction:row}.panel{height:100%;overflow-y:auto}h3{margin-bottom:.25rem}#filmstripPanel{width:10rem;flex-grow:0;flex-shrink:0}#filmstripPanel>ion-button{margin-left:1rem}#editPanel{flex-grow:1;border-left:1px solid var(--border-color);border-right:1px solid var(--border-color);padding:1rem}#toolbar{position:sticky;bottom:0;width:100%;background-color:var(--body-bg);padding:.5rem 1rem;text-align:center}#deleteSlide{height:1rem;width:1rem;float:right}label{color:var(--text-color);font-size:var(--font-size-large);vertical-align:middle}#duration{display:inline-block;width:5rem;vertical-align:bottom;margin-right:5px}`]
        }

        constructor() {
            super(), this._slideState = void 0, this._activeSlideIndex = void 0, this._activeSlide = void 0, this._timeDynamic = !1, this._minimumTime = e.Iso8601.MINIMUM_VALUE.clone(), this._maximumTime = e.Iso8601.MAXIMUM_VALUE.clone()
        }

        _clampToTimeRange(t) {
            return e.JulianDate.compare(t, this._minimumTime) < 0 && (t = this._minimumTime), e.JulianDate.compare(t, this._maximumTime) > 0 && (t = this._maximumTime), t
        }

        onTimelineChanged(t) {
            if (this._timeDynamic = t.visible, this._minimumTime = t.start.clone(), this._maximumTime = t.stop.clone(), t.visible && !e.defined(this._activeSlide.duration)) {
                let t = e.defined(this._activeSlide.startTime) ? e.JulianDate.fromIso8601(this._activeSlide.startTime, Fo) : this._minimumTime,
                    i = e.defined(this._activeSlide.stopTime) ? e.JulianDate.fromIso8601(this._activeSlide.stopTime, Fo) : this._maximumTime;
                requestAnimationFrame(() => {
                    dt.dispatch(Ae(this._activeSlide.id, {
                        startTime: e.JulianDate.toIso8601(this._clampToTimeRange(t)),
                        stopTime: e.JulianDate.toIso8601(this._clampToTimeRange(i)),
                        duration: e.defaultValue(this._activeSlide.duration, 10)
                    }))
                })
            }
            this.requestUpdate()
        }

        render() {
            return z`<div id="filmstripPanel" class="panel"><ion-filmstrip></ion-filmstrip><div id="toolbar"><ion-button theme="primary" @click="${this._onAddSlide}">New slide</ion-button></div></div><div id="editPanel" class="panel">${e.defined(this._activeSlide) ? z`<ion-delete-icon-button id="deleteSlide" ?hidden="${1 === this._slideState.ids.length}" @delete="${this._onDeleteSlideEvent}" message="Delete slide"></ion-delete-icon-button><h3>Title</h3><ion-textfield id="title" class="margin-bottom" .value="${this._activeSlide.name}" @input="${this._onTitleChange}"></ion-textfield><h3>Infobox</h3><ion-wysiwyg-editor id="description" class="margin-bottom" .value="${this._activeSlide.description}" @input="${this._onDescriptionChange}"></ion-wysiwyg-editor><ion-asset-manager class="margin-bottom"></ion-asset-manager>${this.renderAnimationSettings()}` : z``}</div>`
        }

        renderAnimationSettings() {
            if (!this._timeDynamic) return z``;
            const t = e.JulianDate.toIso8601(this._minimumTime), i = e.JulianDate.toIso8601(this._maximumTime);
            return z`<div><h3 class="margin-bottom">Animation settings</h3><ion-datetime id="start-time" .label="${"Start time"}" class="margin-bottom" .min="${t}" .max="${i}" .value="${this._activeSlide.startTime}" @input="${this._onStartTimeChange}"></ion-datetime><ion-datetime id="stop-time" .label="${"Stop time"}" class="margin-bottom" .min="${t}" .max="${i}" .value="${this._activeSlide.stopTime}" @input="${this._onStopTimeChange}"></ion-datetime><ion-number-field id="duration" .label="${"Play time"}" .min="${1}" .value="${this._activeSlide.duration}" @input="${this._onDurationChange}"></ion-number-field><span>seconds</span></div>`
        }

        _onTitleChange(e) {
            const t = e.target;
            dt.dispatch(Ae(this._activeSlide.id, {name: t.value}))
        }

        _onDescriptionChange(e) {
            dt.dispatch(Ae(this._activeSlide.id, {description: e.target.value}))
        }

        _onStartTimeChange(e) {
            dt.dispatch(Ae(this._activeSlide.id, {startTime: e.detail.value})), this.dispatchEvent(new CustomEvent("updateAnimation", {detail: {slide: this._activeSlide}}))
        }

        _onStopTimeChange(e) {
            dt.dispatch(Ae(this._activeSlide.id, {stopTime: e.detail.value})), this.dispatchEvent(new CustomEvent("updateAnimation", {detail: {slide: this._activeSlide}}))
        }

        _onDurationChange(e) {
            const t = e.target;
            t.checkValidity() && (dt.dispatch(Ae(this._activeSlide.id, {duration: Number(t.value)})), this.dispatchEvent(new CustomEvent("updateAnimation", {detail: {slide: this._activeSlide}})))
        }

        _onAddSlide() {
            this.dispatchEvent(new CustomEvent("addSlide", {bubbles: !0, composed: !0, detail: {name: "Untitled"}}))
        }

        _onDeleteSlideEvent() {
            dt.dispatch(Ne(this._activeSlide.id))
        }

        stateChanged(e) {
            let t = !1;
            if (e.story.slides !== this._slideState && (this._slideState = e.story.slides, t = !0), e.app.activeSlideIndex !== this._activeSlideIndex && (this._activeSlideIndex = e.app.activeSlideIndex, t = !0), t) {
                const e = this._slideState;
                this._activeSlide = e.byId[e.ids[this._activeSlideIndex]], this.requestUpdate()
            }
        }
    }

    window.customElements.define("ion-slide-manager", Vo);

    class Ho extends (ne(dt)(ie)) {
        static get styles() {
            return [Ri, ee`h3{margin-bottom:5px}`]
        }

        static get properties() {
            return {unit: {type: String}}
        }

        constructor() {
            super(), this.unit = ""
        }

        render() {
            return z`<h1>Settings</h1><h3>Units</h3><div><input id="metric" type="radio" name="units" value="${wo.METRIC}" ?checked="${this.unit === wo.METRIC}" @change="${this._handleUnit}"> <label for="metric">Metric</label> <input type="radio" id="usCustomary" name="units" value="${wo.US_CUSTOMARY}" ?checked="${this.unit === wo.US_CUSTOMARY}" @change="${this._handleUnit}"> <label for="usCustomary">US Customary</label></div>`
        }

        _handleUnit(e) {
            dt.dispatch($e({unit: e.target.value}))
        }

        stateChanged(e) {
            e.story.unit !== this.unit && (this.unit = e.story.unit)
        }
    }

    window.customElements.define("ion-story-settings", Ho);

    class qo extends (ne(dt)(ie)) {
        static get styles() {
            return [Ri, xo, ee`:host{padding:1rem;height:100%;overflow-y:auto}ion-slider{--slider-text-input-width:5rem}h3{margin-bottom:0}table{width:100%;margin-bottom:1rem;background-color:var(--container-bg);border-radius:var(--border-radius);padding:1rem}cesium-toggle{vertical-align:middle}.error-message{color:var(--brand-danger)}.cesium-theme.cesium-viewer-geocoderContainer *{box-sizing:border-box}.cesium-theme.cesium-viewer-geocoderContainer{font-family:var(--font-family);font-size:var(--font-size);width:100%;margin:0}.cesium-theme.cesium-viewer-geocoderContainer .search-results{background-color:var(--container-bg);border:1px solid var(--gray-lighter);color:var(--text-color);opacity:1;z-index:2;max-height:200px}.cesium-theme.cesium-viewer-geocoderContainer .search-results ul li.active{background:var(--brand-primary-tint)}.cesium-theme .cesium-geocoder-input{padding:16px 14px;background-color:var(--container-bg);color:var(--text-color);border-top-left-radius:var(--border-radius);border-bottom-left-radius:var(--border-radius);border:1px solid var(--border-color);border-right:0}.cesium-theme .cesium-geocoder-input:focus{background-color:var(--container-bg);color:var(--text-color);outline:0}.cesium-theme.cesium-viewer-geocoderContainer .cesium-geocoder-input-wide,.cesium-theme.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input{width:calc(100% - 32px);padding:16px 14px;border-color:var(--border-color);box-shadow:none}.cesium-theme.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus{width:calc(100% - 32px);padding:16px 14px;border-color:var(--brand-primary-tint);outline:0;box-shadow:0 0 .25rem rgba(45,135,196,.4)}.cesium-theme .cesium-geocoder-searchButton{background-color:var(--brand-primary);border:1px solid var(--brand-primary-shade);fill:var(--text-light);border-top-right-radius:var(--border-radius);border-bottom-right-radius:var(--border-radius);margin-top:-1px;margin-right:-1px;height:34px;width:32px;color:var(--text-light)}.cesium-theme .cesium-geocoder-searchButton>svg{vertical-align:middle;width:28px}.cesium-theme .cesium-geocoder-searchButton:hover{background-color:var(--brand-primary-shade)}`]
        }

        static get properties() {
            return {
                ready: {type: Boolean},
                assetId: {type: Number},
                enableNonUniformScaling: {type: Boolean},
                picking: {type: Boolean},
                longitude: {type: Number},
                latitude: {type: Number},
                height: {type: Number},
                heading: {type: Number},
                pitch: {type: Number},
                roll: {type: Number},
                scaleUniform: {type: Number},
                scaleX: {type: Number},
                scaleY: {type: Number},
                scaleZ: {type: Number},
                errorMessage: {type: String}
            }
        }

        constructor() {
            super(), this.ready = !1, this._tileset = void 0, this._scene = void 0, this._domReady = !1, this._geocoder = void 0, this._position = new e.Cartesian3, this._headingPitchRoll = new e.HeadingPitchRoll, this._scale = new e.Cartesian3, this._initialValues = void 0, this._pending = !1, this.picking = !1, this._longitude = 0, this._latitude = 0, this._height = 0, this._heading = 0, this._pitch = 0, this._roll = 0, this._scaleUniform = 0, this._scaleX = 0, this._scaleY = 0, this._scaleZ = 0, this.enableNonUniformScaling = !1, this.errorMessage = ""
        }

        get longitude() {
            return this._longitude
        }

        set longitude(e) {
            this._longitude = Number(e.toFixed(6)), this.requestUpdate()
        }

        get latitude() {
            return this._latitude
        }

        set latitude(e) {
            this._latitude = Number(e.toFixed(6)), this.requestUpdate()
        }

        get height() {
            return this._height
        }

        set height(e) {
            this._height = Number(e.toFixed(6)), this.requestUpdate()
        }

        get heading() {
            return this._heading
        }

        set heading(e) {
            this._heading = Number(e.toFixed(2)), this.requestUpdate()
        }

        get pitch() {
            return this._pitch
        }

        set pitch(e) {
            this._pitch = Number(e.toFixed(2)), this.requestUpdate()
        }

        get roll() {
            return this._roll
        }

        set roll(e) {
            this._roll = Number(e.toFixed(2)), this.requestUpdate()
        }

        get scaleUniform() {
            return this._scaleUniform
        }

        set scaleUniform(e) {
            this._scaleUniform = Number(e.toFixed(2)), this.requestUpdate()
        }

        get scaleX() {
            return this._scaleX
        }

        set scaleX(e) {
            this._scaleX = Number(e.toFixed(2)), this.requestUpdate()
        }

        get scaleY() {
            return this._scaleY
        }

        set scaleY(e) {
            this._scaleY = Number(e.toFixed(2)), this.requestUpdate()
        }

        get scaleZ() {
            return this._scaleZ
        }

        set scaleZ(e) {
            this._scaleZ = Number(e.toFixed(2)), this.requestUpdate()
        }

        set scene(t) {
            if (e.defined(this._scene)) throw new e.DeveloperError("scene is already set");
            this._scene = t, this._attachGeocoder()
        }

        set position(t) {
            e.Cartesian3.clone(t, this._position);
            const i = e.Ellipsoid.WGS84.cartesianToCartographic(t), n = e.Math.toDegrees(i.longitude),
                o = e.Math.toDegrees(i.latitude), r = i.height;
            e.Math.equalsEpsilon(n, this.longitude, e.Math.EPSILON8) && e.Math.equalsEpsilon(o, this.latitude, e.Math.EPSILON8) && e.Math.equalsEpsilon(r, this.height, e.Math.EPSILON8) || (this.longitude = n, this.latitude = o, this.height = r, this.requestUpdate())
        }

        set headingPitchRoll(t) {
            e.HeadingPitchRoll.equals(t, this._headingPitchRoll) || (e.HeadingPitchRoll.clone(t, this._headingPitchRoll), this.heading = e.Math.toDegrees(t.heading), this.pitch = e.Math.toDegrees(t.pitch), this.roll = e.Math.toDegrees(t.roll), this.requestUpdate())
        }

        set scale(t) {
            e.Cartesian3.equals(t, this._scale) || (e.Cartesian3.clone(t, this._scale), this.scaleUniform = t.x, this.scaleX = t.x, this.scaleY = t.y, this.scaleZ = t.z, this.requestUpdate())
        }

        firstUpdated() {
            this._domReady = !0, this._attachGeocoder()
        }

        render() {
            return z`<h2>Adjust Tileset Location</h2><ion-button theme="primary" class="margin-bottom" @click="${this.flyTo}">Zoom to tileset</ion-button><h3>Position</h3><table><tbody><tr><td><label>Search</label></td><td><div id="geocoder" class="cesium-theme cesium-viewer-geocoderContainer"></div></td></tr><tr><td><label>Longitude</label></td><td><ion-number-field id="longitude" min="-180" max="180" step="0.0001" .value="${this.longitude}" @input="${this._updatePosition}"></ion-number-field></td></tr><tr><td><label>Latitude</label></td><td><ion-number-field id="latitude" min="-90" max="90" step="0.0001" .value="${this.latitude}" @input="${this._updatePosition}"></ion-number-field></td></tr><tr><td><label>Height</label></td><td><ion-number-field id="height" step="1" .value="${this.height}" @input="${this._updatePosition}"></ion-number-field></td></tr><tr><td colspan="2"><div class="alert alert-info" ?hidden="${!this.picking}">Click the globe to set the tileset position</div><ion-button @click="${this.activatePicking}" ?hidden="${this.picking}">Click position</ion-button><ion-button @click="${this.cancelPicking}" ?hidden="${!this.picking}">Cancel</ion-button></td></tr></tbody></table><h3>Rotation</h3><table><tbody><tr><td><label>Heading</label></td><td><ion-slider id="heading" min="-180" max="180" step="1" .value="${this.heading}" @input="${this._updateHPR}"></ion-slider></td></tr><tr><td><label>Pitch</label></td><td><ion-slider id="pitch" min="-180" max="180" step="1" .value="${this.pitch}" @input="${this._updateHPR}"></ion-slider></td></tr><tr><td><label>Roll</label></td><td><ion-slider id="roll" min="-180" max="180" step="1" .value="${this.roll}" @input="${this._updateHPR}"></ion-slider></td></tr></tbody></table><h3>Scale</h3><table><tbody><tr><td colspan="2"><label>Non-uniform scaling</label><cesium-toggle ?checked="${this.enableNonUniformScaling}" @change="${this._toggleUniformScaling}"></cesium-toggle></td></tr><tr ?hidden="${this.enableNonUniformScaling}"><td><label>Scale</label></td><td><ion-number-field id="uniformScale" min="0.1" step="0.1" .value="${this.scaleUniform}" @input="${this._updateScale}"></ion-number-field></td></tr><tr ?hidden="${!this.enableNonUniformScaling}"><td><label>Scale X</label></td><td><ion-number-field id="scaleX" min="0.1" step="0.1" .value="${this.scaleX}" @input="${this._updateScale}"></ion-number-field></td></tr><tr ?hidden="${!this.enableNonUniformScaling}"><td><label>Scale Y</label></td><td><ion-number-field id="scaleY" min="0.1" step="0.1" .value="${this.scaleY}" @input="${this._updateScale}"></ion-number-field></td></tr><tr ?hidden="${!this.enableNonUniformScaling}"><td><label>Scale Z</label></td><td><ion-number-field id="scaleZ" min="0.1" step="0.1" .value="${this.scaleZ}" @input="${this._updateScale}"></ion-number-field></td></tr></tbody></table><div><ion-button theme="primary" @click="${this.save}">Save</ion-button><ion-button @click="${this.reset}">Reset</ion-button><ion-button @click="${this.cancel}}">Cancel</ion-button><p class="error-message">${this.errorMessage}</p></div>`
        }

        initializeValues(t, i, n, o, r, a) {
            this._viewer = t, this.scene = t.scene, this._tileset = i, this.position = n, this.headingPitchRoll = o, this.scale = r, this.enableNonUniformScaling = a, this._initialValues = {
                position: e.Cartesian3.clone(n),
                headingPitchRoll: e.HeadingPitchRoll.clone(o),
                scale: e.Cartesian3.clone(r),
                enableNonUniformScaling: a
            }, this.ready = !0, this.requestUpdate()
        }

        activatePicking() {
            this.picking = !0, this.dispatchEvent(new CustomEvent("pickingChange", {detail: {picking: !0}})), this.requestUpdate()
        }

        cancelPicking() {
            this.picking = !1, this.dispatchEvent(new CustomEvent("pickingChange", {detail: {picking: !1}})), this.requestUpdate()
        }

        _toggleUniformScaling() {
            this.enableNonUniformScaling = !this.enableNonUniformScaling, this.dispatchEvent(new CustomEvent("enableNonUniformScalingChange", {detail: {enableNonUniformScaling: this.enableNonUniformScaling}})), this.requestUpdate()
        }

        _updatePosition() {
            this.errorMessage = "";
            const t = this.shadowRoot.querySelector("#longitude"), i = this.shadowRoot.querySelector("#latitude"),
                n = this.shadowRoot.querySelector("#height");
            let o = t.checkValidity();
            if (o = i.checkValidity() && o, o = n.checkValidity() && o, !o) return;
            const r = Number(t.value), a = Number(i.value), s = Number(n.value);
            this.longitude = r, this.latitude = a, this.height = s;
            const c = this._position;
            e.Cartesian3.fromDegrees(r, a, s, e.Ellipsoid.WGS84, c), this.dispatchEvent(new CustomEvent("positionChange", {detail: {position: c}}))
        }

        _updateHPR() {
            this.errorMessage = "";
            const t = this.shadowRoot.querySelector("#heading"), i = this.shadowRoot.querySelector("#pitch"),
                n = this.shadowRoot.querySelector("#roll");
            let o = t.checkValidity();
            if (o = i.checkValidity() && o, o = n.checkValidity() && o, !o) return;
            const r = Number(t.value), a = Number(i.value), s = Number(n.value);
            this.heading = r, this.pitch = a, this.roll = s;
            const c = this._headingPitchRoll;
            c.heading = e.Math.toRadians(r), c.pitch = e.Math.toRadians(a), c.roll = e.Math.toRadians(s), this.dispatchEvent(new CustomEvent("headingPitchRollChange", {detail: {headingPitchRoll: c}}))
        }

        _updateScale() {
            this.errorMessage = "";
            const e = this._scale;
            if (this.enableNonUniformScaling) {
                const t = this.shadowRoot.querySelector("#scaleX"), i = this.shadowRoot.querySelector("#scaleY"),
                    n = this.shadowRoot.querySelector("#scaleZ");
                let o = t.checkValidity();
                if (o = i.checkValidity() && o, o = n.checkValidity() && o, !o) return;
                const r = Number(t.value), a = Number(i.value), s = Number(n.value);
                this.scaleX = r, this.scaleY = a, this.scaleZ = s, e.x = r, e.y = a, e.z = s, this.dispatchEvent(new CustomEvent("scaleChange", {detail: {scale: e}}))
            } else {
                const t = this.shadowRoot.querySelector("#uniformScale");
                if (!t.checkValidity()) return;
                const i = Number(t.value);
                this.scaleUniform = i, e.x = i, e.y = i, e.z = i, this.dispatchEvent(new CustomEvent("scaleChange", {detail: {scale: e}}))
            }
        }

        _attachGeocoder() {
            if (!e.defined(this._scene) || !this._domReady) return;
            const t = new e.Geocoder({
                scene: this._scene,
                container: this.shadowRoot.querySelector("#geocoder"),
                destinationFound: this.onDestinationFound.bind(this)
            });
            t.viewModel.keepExpanded = !0, this._geocoder = t
        }

        async onDestinationFound(t, i) {
            if (this._pending) return;
            const n = this._scene,
                o = i instanceof e.Rectangle ? e.Rectangle.center(i) : e.Ellipsoid.WGS84.cartesianToCartographic(i);
            this._pending = !0;
            const r = n.globe.terrainProvider;
            let a, s;
            if (r instanceof e.EllipsoidTerrainProvider) a = o, a.height = 0, s = e.Ellipsoid.WGS84.cartographicToCartesian(o); else try {
                const t = await e.sampleTerrainMostDetailed(r, [o]);
                s = e.Ellipsoid.WGS84.cartographicToCartesian(t[0])
            } catch (t) {
                o.height = n.globe.getHeight(o), s = e.Ellipsoid.WGS84.cartographicToCartesian(o)
            }
            this.position = e.Cartesian3.clone(s, this._position), this.dispatchEvent(new CustomEvent("positionChange", {detail: {position: s}})), this._pending = !1, this.flyTo()
        }

        flyTo() {
            yo(this._viewer, this._tileset)
        }

        save() {
            let e = !0;
            e = this.shadowRoot.querySelector("#longitude").checkValidity() && e, e = this.shadowRoot.querySelector("#latitude").checkValidity() && e, e = this.shadowRoot.querySelector("#height").checkValidity() && e, e = this.shadowRoot.querySelector("#heading").checkValidity() && e, e = this.shadowRoot.querySelector("#pitch").checkValidity() && e, e = this.shadowRoot.querySelector("#roll").checkValidity() && e, this.enableNonUniformScaling ? (e = this.shadowRoot.querySelector("#scaleX").checkValidity() && e, e = this.shadowRoot.querySelector("#scaleY").checkValidity() && e, e = this.shadowRoot.querySelector("#scaleZ").checkValidity() && e) : e = this.shadowRoot.querySelector("#uniformScale").checkValidity() && e, e ? (this.errorMessage = "", this.dispatchEvent(new CustomEvent("save")), this.close()) : this.errorMessage = "At least one field has an invalid value"
        }

        reset() {
            if (e.defined(this._initialValues)) {
                const e = this._initialValues;
                this.enableNonUniformScaling = e.enableNonUniformScaling, this.position = e.position, this.headingPitchRoll = e.headingPitchRoll, this.scale = e.scale, this.dispatchEvent(new CustomEvent("positionChange", {detail: {position: this._position}})), this.dispatchEvent(new CustomEvent("headingPitchRollChange", {detail: {headingPitchRoll: this._headingPitchRoll}})), this.dispatchEvent(new CustomEvent("scaleChange", {detail: {scale: this._scale}})), this.requestUpdate()
            }
        }

        cancel() {
            this.reset(), this.close()
        }

        close() {
            e.defined(this._geocoder) && (this._geocoder.destroy(), this._geocoder = void 0, this._scene = void 0), dt.dispatch(de(void 0))
        }

        stateChanged(e) {
            this.assetId = e.app.transformEditorAssetId
        }
    }

    window.customElements.define("ion-transform-editor-panel", qo);

    class Bo extends (ne(dt)(ie)) {
        static get styles() {
            return [Ri, ee`:host{position:fixed;top:3rem;bottom:1.5rem;right:0;left:0;z-index:3;background-color:var(--container-bg)}#storiesFrame{width:100%;height:100%}`]
        }

        static get properties() {
            return {droppedFiles: {type: Object}, iframeLoaded: {type: Boolean}}
        }

        constructor() {
            super(), this.droppedFiles = void 0, this.iframeLoaded = !1, this.onMessage = this.onMessage.bind(this), this._contentWindow = void 0, this._activeSlide = void 0
        }

        async addDroppedFiles(t) {
            if (e.defined(t)) if (this.iframeLoaded) {
                const e = (t = await t).map(e => e.__ionKey);
                this._contentWindow.postMessage({files: t, paths: e}, window.location.origin, [])
            } else this.droppedFiles = t
        }

        connectedCallback() {
            super.connectedCallback(), window.addEventListener("message", this.onMessage, !1)
        }

        disconnectedCallback() {
            window.removeEventListener("message", this.onMessage, !1), super.disconnectedCallback()
        }

        createOnProgressUpdate(t, i, n) {
            let o = {loaded: 0, total: 0}, r = 0;
            return a => {
                e.defined(a.total) && a.total > 0 ? (o.loaded = a.loaded, o.total = a.total) : a.loaded > 0 && (o.loaded = o.total);
                const s = Math.round(99 * (o.loaded / o.total + i) / n);
                s > r && (r = s, dt.dispatch(ue(t, s)))
            }
        }

        async onMessage(t) {
            if (t.data.ready) return this.iframeLoaded = !0, void this.addDroppedFiles(this.droppedFiles);
            if (this.dispatchEvent(new CustomEvent("close")), t.data.cancel) return;
            const i = t.data, n = i.metadata, o = await async function (t) {
                return e.Resource.postJson({url: `${ge}v1/assets`, data: t})
            }(n), r = o.isExternal ? o : o.assetMetadata;
            r.type === se.TERRAIN ? dt.dispatch(Ae(this._activeSlide.id, {terrainAssetId: r.id})) : dt.dispatch(ze(r.id));
            const a = o.uploadLocation;
            if (!e.defined(a)) return;
            const s = i.keys, c = i.bodies, l = new AWS.S3({
                apiVersion: "2006-03-01",
                region: "us-east-1",
                signatureVersion: "v4",
                endpoint: a.endpoint,
                credentials: new AWS.Credentials(a.accessKey, a.secretAccessKey, a.sessionToken)
            });
            dt.dispatch(ue(r.id, 0));
            const d = c.length;
            for (let e = 0; e < d; e++) {
                let t = a.prefix + s[e];
                const i = l.upload({Body: c[e], Bucket: a.bucket, ContentType: "application/octet-stream", Key: t});
                i.on("httpUploadProgress", this.createOnProgressUpdate(r.id, e, d)), await i.promise()
            }
            dt.dispatch(ue(r.id, 100));
            const u = o.onComplete;
            await e.Resource.postJson({url: u.url, method: u.method, body: u.fields})
        }

        render() {
            return z`<ion-loading-icon ?hidden="${this.iframeLoaded}" ?centered="${!0}"></ion-loading-icon><iframe ?hidden="${!this.iframeLoaded}" id="storiesFrame" frameborder="0" src="../../addasset" @load="${this._onIframeLoaded}"></iframe>`
        }

        async _onIframeLoaded(e) {
            this._contentWindow = e.target.contentWindow
        }

        stateChanged(e) {
            this._activeSlide = we(e)
        }
    }

    window.customElements.define("ion-asset-upload", Bo);
    window.customElements.define("ion-map-viewer-error", class extends ie {
        static get styles() {
            return [Ri, ee`:host{height:100%;width:100%;--body-bg:var(--brand-dark);--text-color:var(--text-light)}p{font-size:16px}`]
        }

        static get properties() {
            return {storyId: {type: String}}
        }

        constructor() {
            super(), this.storyId = ""
        }

        render() {
            const t = this.storyId, i = new e.Resource({
                url: "https://github.com/AnalyticalGraphicsInc/cesium-ion-community/issues/new",
                queryParameters: {title: `Unable to view story with id: ${t}`}
            });
            return z`<div class="text-center" style="margin-bottom:40px"><img src="../../Images/logo.svg" alt="Cesium ion" style="width:200px;max-width:100%"></div><h1 class="text-center margin-bottom">Whoops</h1><p class="text-center">There was an unexpected error and this story cannot be loaded.</p><p>For help, <a href="${i.url}" target="_blank" rel="noopener">open an issue</a> in our Github repository or email <a href="mailto:support@cesium.com" target="_blank" rel="noopener">support@cesium.com</a> with story id: ${t}.</p>`
        }
    });

    class Wo extends (ne(dt)(ie)) {
        static get styles() {
            return [Ri]
        }

        static get properties() {
            return {name: {type: String}}
        }

        constructor() {
            super(), this.name = ""
        }

        render() {
            return z`<h3>Name before sharing</h3><ion-textfield id="name" class="margin-bottom" value="${this.name}" label="Story name"></ion-textfield><ion-button theme="primary" @click="${this._close}">Okay</ion-button>`
        }

        _close() {
            const e = this.shadowRoot.querySelector("#name").value;
            e === this.name || Tn(e) || dt.dispatch($e({name: e})), dt.dispatch(le(Ve))
        }

        stateChanged(e) {
            this.name = e.story.name
        }
    }

    window.customElements.define("ion-untitled-prompt", Wo);
    window.customElements.define("ion-textarea", class extends ie {
        static get styles() {
            return [En, ee`.ion-form-input{height:initial}`]
        }

        static get properties() {
            return {label: {type: String}, value: {type: String}, rows: {type: Number}, readonly: {type: Boolean}}
        }

        constructor() {
            super(), this.label = "", this.rows = 5, this.readonly = !1, this._value = "", this._elementId = `ion-${e.createGuid()}`
        }

        get value() {
            const t = this.shadowRoot.querySelector(`#${this._elementId}`);
            return e.defined(t) && (this._value = t.value), this._value
        }

        set value(t) {
            this._value = t;
            const i = this.shadowRoot.querySelector(`#${this._elementId}`);
            e.defined(i) && (i.value = t), this.requestUpdate()
        }

        select() {
            const t = this.shadowRoot.querySelector(`#${this._elementId}`);
            e.defined(t) && select(t)
        }

        render() {
            return z`<label for="${this._elementId}">${this.label}</label> <textarea id="${this._elementId}" class="ion-form-input" rows="${this.rows}" ?readonly="${this.readonly}">${this._value}</textarea>`
        }
    });

    class Yo extends (ne(dt)(ie)) {
        static get styles() {
            return [Ri, ee`button svg{height:1rem;width:1rem}.copy-icon{margin-left:5px}.confirm-copy{float:right;color:var(--text-muted);opacity:0;transition:opacity var(--transition-time) ease-out}.confirm-copy.copied{opacity:1}#shareLink ion-textarea{display:inline-block;width:calc(100% - 2.5rem)}#shareLink ion-icon-button{vertical-align:top}#shareOptions{display:flex}.share-button{text-align:center;margin-right:1.5rem}.share-button>*{display:block}.share-button>.icon{background-color:var(--container-bg);border-radius:50%;width:1.75rem;height:1.75rem;border:1rem solid #fff;box-sizing:content-box}.share-button>.icon svg{width:1.75rem;height:1.75rem}`]
        }

        constructor() {
            super(), this._storyId = "", this._sharedUrl = "", this._embedCode = "", this._name = "", this._copiedTimeout = void 0
        }

        render() {
            return z`<h1>Embed story</h1><div id="shareLink" class="margin-bottom"><div><label>Embed code</label><span class="confirm-copy">Copied</span></div><div><ion-textarea id="code" value="${this._embedCode}" @click="${this._selectText("code")}" readonly="readonly"></ion-textarea><ion-icon-button class="copy-icon" @click="${this._copyCode}">${hi.node}</ion-icon-button></div></div><ion-button theme="primary" @click="${this._close}">Okay</ion-button>`
        }

        _selectText(e) {
            return function () {
                this.shadowRoot.querySelector(`#${e}`).select()
            }
        }

        _copyCode() {
            const e = this.shadowRoot.querySelector("#code");
            e.focus(), e.select();
            try {
                document.execCommand("copy");
                const e = this.shadowRoot.querySelector("#shareLink .confirm-copy");
                e.classList.add("copied"), clearTimeout(this._copiedTimeout), this._copiedTimeout = setTimeout(() => {
                    e.classList.remove("copied")
                }, 1500)
            } catch (e) {
                console.log(e)
            }
        }

        _close() {
            this.dispatchEvent(new CustomEvent("close", {bubbles: !0, composed: !0}))
        }

        stateChanged(e) {
            let t = !1;
            if (e.story.id !== this._storyId) {
                this._storyId = e.story.id;
                const i = window.location.href;
                this._sharedUrl = `${i.replace("editor", "viewer").replace("#", "?id=")}`, t = !0, this.requestUpdate()
            }
            (t || e.story.name !== this._name) && (this._name = e.story.name, this._embedCode = `<iframe title="${e.story.name}" width="1024" height="576" src="${this._sharedUrl}" frameborder="0" allow="fullscreen" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>`, this.requestUpdate())
        }
    }

    window.customElements.define("ion-embed-dialog", Yo);

    class Go extends (ne(dt)(ie)) {
        static get styles() {
            return [Ri, ee`:host{height:100%;width:100%}:host([dragging]) #dropZone{display:block}ion-nav{height:3rem}#content{display:flex;flex-direction:row;flex-grow:1;height:calc(100% - 3rem)}#sidePanel{width:35rem;height:100%;flex:none}ion-map-viewer{flex-grow:1}ion-slide-manager{width:100%;height:100%}ion-notification{pointer-events:auto}#notificationContainer{display:block;position:absolute;z-index:2;top:1rem;right:1rem;width:20rem;pointer-events:none}ion-notification+ion-notification{margin-top:1rem}#thumbnailModal{margin:0;text-align:center}#thumbnailModal h3{margin-bottom:.5rem}#thumbnailModal ion-loading-icon{width:1.5rem;height:1.5rem;margin:0 auto}a svg{height:.75rem;width:.75rem}#captureView{position:absolute;top:4rem;left:36rem;z-index:2}#dropZone{display:none;position:absolute;top:0;bottom:0;left:0;right:0;background-color:var(--transparent-overlay-color);z-index:3}`]
        }

        static get properties() {
            return {
                loading: {type: Boolean},
                modalType: {type: String},
                unit: {type: String},
                activeSlide: {type: Object},
                assetState: {type: Object},
                transformEditorActive: {type: Boolean},
                dragging: {type: Boolean, reflect: !0},
                viewerError: {type: Boolean}
            }
        }

        constructor() {
            super(), this.dragging = !1, this.loading = false, this.modalType = void 0, this.assetState = void 0,
                this.activeSlide = void 0, this.unit = void 0, this.viewerError = !1, this.transformEditorActive = !1,
                this._activeSlideIndex = void 0, this._viewer = void 0, this._storyId = void 0,
                this.onDragEnter = this.onDragEnter.bind(this),
                this.onDragOver = this.onDragOver.bind(this),
                this.onDragLeave = this.onDragLeave.bind(this),
                this.onDrop = this.onDrop.bind(this),
                this._notifications = {
                byId: {},
                ids: []
            }
            , async function () {
                return e.Resource.fetchJson({url: ge + "refresh"})
            }().then(t => {
                e.defined(t) || window.location.replace("../../signin/stories/editor/" + window.location.hash), e.Ion.defaultAccessToken = t.token;
                let i = window.location.hash;
                i.length > 0 ? dt.dispatch(Pe(i.substr(1))) : dt.dispatch(De())
            }).catch(e => {
                451 === e.statusCode && window.location.replace("https://cesium.com/unavailable.html")
            })
                , this.onKeyDown = this.onKeyDown.bind(this)
        }

        canDrop(t) {
            if (this.modalType !== je || this.transformEditorActive) return !1;
            let i = !1;
            const n = t.dataTransfer.types;
            if (e.defined(n)) for (let e = 0; e < n.length; e++) if (/^Files$/i.test(n[e])) {
                i = !0;
                break
            }
            return !!i && (t.stopPropagation(), t.preventDefault(), !0)
        }

        getFiles(e, t) {
            return new Promise((i, n) => {
                if (!e.isDirectory) {
                    const o = e.fullPath.replace(/^(\/|\\)/, "");
                    return void e.file((function (e) {
                        e.__ionKey = o, t.push(e), i()
                    }), (function (e) {
                        n(e)
                    }))
                }
                const o = [], r = e.createReader(), a = e => {
                    if (0 !== e.length) return e.forEach((function (e) {
                        o.push(this.getFiles(e, t))
                    })), void r.readEntries(a, n);
                    Promise.all(o).then((function () {
                        i()
                    })).catch(n)
                };
                r.readEntries(a, n)
            })
        }

        onDragEnter(e) {
            if (!this.canDrop(e)) return !1;
            this.dragging = !0
        }

        onDragOver(e) {
            if (!this.canDrop(e)) return !1;
            this.dragging = !0
        }

        onDragLeave(e) {
            if (!this.canDrop(e)) return !1;
            this.dragging = !1
        }

        onDrop(t) {
            if (!this.canDrop(t)) return this.dragging = !1, !1;
            t.stopPropagation(), t.preventDefault();
            const i = t.dataTransfer;
            let n = Promise.resolve(i.files);
            const o = i.items;
            if (e.defined(o)) {
                const t = [], i = [];
                for (let n = 0; n < o.length; n++) {
                    const r = o[n];
                    let a;
                    try {
                        a = e.defined(r.getAsEntry) ? r.getAsEntry() : r.webkitGetAsEntry()
                    } catch (e) {
                    }
                    e.defined(a) && i.push(this.getFiles(a, t))
                }
                n = Promise.all(i).then(() => t)
            }
            return this.modalType === Be ? this.shadowRoot.querySelector("ion-asset-upload").addDroppedFiles(n) : (this._droppedFiles = n, dt.dispatch(le(Be))), this.dragging = !1, !0
        }

        connectedCallback() {
            super.connectedCallback(), document.addEventListener("dragenter", this.onDragEnter, !0), document.addEventListener("dragover", this.onDragOver, !0), document.addEventListener("dragleave", this.onDragLeave, !0), document.addEventListener("drop", this.onDrop, !0), document.addEventListener("keydown", this.onKeyDown, !0), this._pollAssets()
        }

        disconnectedCallback() {
            document.removeEventListener("dragenter", this.onDragEnter, !0), document.removeEventListener("dragover", this.onDragOver, !0), document.removeEventListener("dragleave", this.onDragLeave, !0), document.removeEventListener("drop", this.onDrop, !0), document.removeEventListener("keydown", this.onKeyDown, !0), super.disconnectedCallback()
        }

        onKeyDown(e) {
            if (e.ctrlKey && ("s" === e.key || 83 === e.keyCode)) return e.stopPropagation(), e.preventDefault(), void (this.modalType === je && dt.dispatch((t = "saveMessage", i = "Don't worry, Stories autosaves!", e => {
                e({type: "SHOW_INFO", id: t, message: i})
            })));
            var t, i;
            if (this.modalType !== je || document.hasFocus() && document.activeElement !== document.body && document.activeElement !== document.documentElement) return;
            let n = this._activeSlideIndex;
            if (n > 0 && ("ArrowLeft" === e.key || 37 === e.keyCode || "ArrowUp" === e.key || 38 === e.keyCode || "PageUp" === e.key || 33 === e.keyCode)) n--; else {
                if (!(n < this._totalSlides - 1) || "ArrowRight" !== e.key && 39 !== e.keyCode && "ArrowDown" !== e.key && 40 !== e.keyCode && "PageDown" !== e.key && 34 !== e.keyCode) return;
                n++
            }
            dt.dispatch(ce(n)), e.stopPropagation(), e.preventDefault()
        }

        render() {
            return z`${this.loading ?
                z`<ion-loading-icon .visible="${!0}" .centered="${!0}"></ion-loading-icon><div id="notificationContainer"></div>`
                : z`${this._renderModal()}<div id="content"><div id="sidePanel"><ion-slide-manager ?hidden="${this.transformEditorActive}" @zoomToAsset="${this._onZoomToAsset}" @addSlide="${this._onAddSlide}" @updateAnimation="${this._onUpdateAnimation}"></ion-slide-manager><ion-transform-editor-panel ?hidden="${!this.transformEditorActive}"></ion-transform-editor-panel></div><ion-button id="captureView" @click="${this._onCaptureViewClick}" ?hidden="${this.transformEditorActive}">${Ti.node} Capture view</ion-button><ion-map-viewer ?widgetsHidden="${this.transformEditorActive}" @viewerInitialized="${this._viewerInitialized}" @viewerError="${this._onViewerError}" @timelineChanged="${this._timelineChanged}" @timelineTrimChanged="${this._onTimelineTrimChanged}" .assetState="${this.assetState}" .activeSlide="${this.activeSlide}" .unit="${this.unit}"></ion-map-viewer></div>`}`
        }

        _viewerInitialized(e) {
            this._tilesetTransformHelper = new Ui(this.shadowRoot.querySelector("ion-transform-editor-panel"), e.target)
        }

        _onViewerError(e) {
            console.error(e.detail.error.message), this.viewerError = !0, this.requestUpdate()
        }

        _renderModal() {
            return this.viewerError ? z`<ion-modal><ion-map-viewer-error class="margin-bottom" .storyId="${this._storyId}"></ion-map-viewer-error><ion-button theme="primary" @click="${this._returnToIon}">Return to ion</ion-button></ion-modal>` : this.modalType === Fe ? z`<ion-modal @close="${this._onAddAsset}"><ion-asset-selector></ion-asset-selector></ion-modal>` : this.modalType === Ve ? z`<ion-modal @close="${this._onCloseModal}"><ion-sharing-options></ion-sharing-options></ion-modal>` : this.modalType === qe ? z`<ion-modal id="thumbnailModal"><h3>Capturing view</h3><ion-loading-icon ?centered="${!1}"></ion-loading-icon></ion-modal>` : this.modalType === He ? z`<ion-modal @close="${this._onCloseModal}"><ion-story-settings class="margin-bottom"></ion-story-settings><ion-button theme="primary" @click="${this._onCloseModal}">Okay</ion-button></ion-modal>` : this.modalType === Be ? z`<ion-modal @close="${this._onCloseModal}"><ion-asset-upload @close="${this._onCloseModal}" .droppedFiles="${this._droppedFiles}"></ion-asset-upload></ion-modal>` : this.modalType === We ? z`<ion-modal @close="${this._onCloseModal}"><ion-untitled-prompt></ion-untitled-prompt></ion-modal>` : this.modalType === Ye ? z`<ion-modal @close="${this._onCloseModal}"><ion-embed-dialog></ion-embed-dialog></ion-modal>` : z``
        }

        async _pollAssets() {
            const e = dt.getState().story.assets, t = e.ids.map(async t => {
                try {
                    const i = e.byId[t];
                    if (!re.isPending(i.status)) return;
                    const n = await _e(t);
                    n.status === re.COMPLETE && n.type === se["3DTILES"] && (n.ionExtras = await ye(i.id)), dt.getState().story.assets.ids.includes(t) && dt.dispatch(((e, t) => async i => {
                        i({type: "UPDATE_ASSET", assetId: e, assetMetadata: t})
                    })(t, n))
                } catch (e) {
                    console.log(e)
                }
            });
            await Promise.all(t), this.isConnected && setTimeout(() => this._pollAssets(), 5e3)
        }

        _onZoomToAsset(e) {
            this.shadowRoot.querySelector("ion-map-viewer").zoomToAsset(e.detail.assetId)
        }

        _onUpdateAnimation(e) {
            this.shadowRoot.querySelector("ion-map-viewer").updateAnimation(e.detail.slide)
        }

        async _captureThumbnail(e) {
            let t = 256, i = 144;
            0 === this._activeSlideIndex && (t *= 2, i *= 2), dt.dispatch(le(qe));
            const n = Date.now(), o = await e.captureThumbnail(t, i), r = Date.now() - n;
            return r >= 750 ? dt.dispatch(le(je)) : setTimeout(() => dt.dispatch(le(je)), 750 - r), o
        }

        async _onAddSlide(t) {
            const i = this.shadowRoot.querySelector("ion-map-viewer"), n = i.viewer.camera;
            e.defined(n._currentFlight) && (n.cancelFlight(), i.zoomToSlide(i.activeSlide));
            const o = await this._captureThumbnail(i), r = this.activeSlide;
            dt.dispatch(Ie({
                name: t.detail.name,
                description: t.detail.description,
                thumbnail: o,
                terrainAssetId: r.terrainAssetId,
                startTime: r.startTime,
                stopTime: r.stopTime,
                duration: r.duration,
                view: {camera: i.cameraView},
                assetSettings: r.assetSettingsTransformEditor
            }))
        }

        async _onCaptureViewClick() {
            const e = this.shadowRoot.querySelector("ion-map-viewer"), t = await this._captureThumbnail(e);
            dt.dispatch(Ae(this.activeSlide.id, {thumbnail: t, view: {camera: e.cameraView}}))
        }

        async _onCloseModal() {
            e.defined(this._droppedFiles) && (this._droppedFiles = void 0, this.requestUpdate()), dt.dispatch(le(je))
        }

        async _onAddAsset(t) {
            dt.dispatch(le(je));
            const i = t.detail;
            if (!e.defined(i)) return;
            const n = i.asset;
            e.defined(n) && dt.dispatch(ze(n.id))
        }

        _onCloseNotification(e) {
            var t;
            dt.dispatch((t = e.detail.id, e => {
                e({type: "CLOSE_NOTIFICATION", id: t})
            }))
        }

        _onTimelineTrimChanged(t) {
            const i = e.defaultValue(t.detail.start, this.activeSlide.startTime),
                n = e.defaultValue(t.detail.stop, this.activeSlide.stopTime);
            dt.dispatch(Ae(this.activeSlide.id, {startTime: i, stopTime: n}))
        }

        _timelineChanged(e) {
            this.shadowRoot.querySelector("ion-slide-manager").onTimelineChanged(e.detail)
        }

        _returnToIon() {
            window.location = "../../stories/"
        }

        stateChanged(t) {
            this.loading && e.defined(t.story.id) && (window.location.replace("./#" + t.story.id), this.loading = !1), this.modalType = t.app.modalType, this._storyId = t.story.id, this.assetState = t.story.assets, this._activeSlideIndex = t.app.activeSlideIndex, this._totalSlides = t.story.slides.ids.length, this.activeSlide = we(t), this.unit = t.story.unit, e.defined(this._tilesetTransformHelper) && (this._tilesetTransformHelper.assetId = t.app.transformEditorAssetId), this.transformEditorActive = e.defined(t.app.transformEditorAssetId), window.hasPendingUploads = 0 !== Object.keys(t.app.pendingUploads).length;
            const i = t.app.notifications;
            if (i !== this._notifications) {
                const e = this.shadowRoot.querySelector("#notificationContainer"), t = this._notifications,
                    n = t.ids.filter(e => !i.ids.includes(e)), o = i.ids.filter(e => !t.ids.includes(e)),
                    r = i.ids.filter(e => t.ids.includes(e));
                n.forEach(t => {
                    const i = e.querySelector(`#${t}`);
                    e.removeChild(i), i.removeEventListener("close", this._onCloseNotification.bind(this))
                }), o.forEach(t => {
                    const n = i.byId[t], o = document.createElement("ion-notification");
                    o.setAttribute("id", t), o.setAttribute("notificationType", n.type), o.setAttribute("timeout", n.timeout), o.message = n.message, o.addEventListener("close", this._onCloseNotification.bind(this)), e.appendChild(o)
                }), r.forEach(t => {
                    const n = e.querySelector(`#${t}`), o = i.byId[t];
                    n.message = o.message
                }), this._notifications = i
            }
        }
    }

    window.customElements.define("ion-app", Go),
        window.addEventListener("beforeunload", (function (e) {
        window.hasPendingUploads ? e.returnValue = "File uploads in progress, leaving will cancel the upload." : window.hasUnsavedChanges && (e.returnValue = "You story failed to save, leaving will lose your unsaved changes.")
    }))
}(Cesium, Cesium);
